You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2001/10/31 03:06:36 UTC

DO NOT REPLY [Bug 4533] New: - strange mixing of param-value

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4533>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4533

strange mixing of param-value

           Summary: strange mixing of param-value
           Product: XalanJ2
           Version: 2.2.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: javax.xml
        AssignedTo: xalan-dev@xml.apache.org
        ReportedBy: joerg.heinicke@gmx.de


Sorry, that I can't really give short code-snippets. These stylesheets I didn't 
wrote and they are a little bit complex. But I think I changed them (with 
adding <xsl:message> at the correct places) so, that you can find the error.

The stylesheets are from RenderX and they create a barcode in xsl-fo/pdf. Only 
the barcode-number is needed. http://www.renderx.com/barcodes.html. From there 
you can get bartest.xml (http://www.renderx.com/Tests/barcodes/bartest.xml), 
bartest-FO.xsl (http://www.renderx.com/Tests/barcodes/bartest-FO.xsl), barcode-
EAN-FO.xsl (http://www.renderx.com/Tests/barcodes/barcode-EAN-FO.xsl) and the 
problem-file barcode-EAN-logic.xsl 
(http://www.renderx.com/Tests/barcodes/barcode-EAN-logic.xsl). The last one is 
the important, error causing one.

The important template is (starting at line 213) named 'barcode-EAN-cleaned'. 
>From there the template named 'draw-barcode-EAN' is called (line 256) with many 
<xsl:with-param>s:

  <xsl:call-template name="draw-barcode-EAN"> 

    <!-- Dimensional attributes -->
    <xsl:with-param name="module" select="$module"/>
    <xsl:with-param name="unit" select="$unit"/>
    <xsl:with-param name="height" select="$height"/>

    <!-- String components -->
    <xsl:with-param name="first-digit" select="normalize-space($first-digit)"/>
    <xsl:with-param name="last-digit" select="normalize-space($last-digit)"/>
    <xsl:with-param name="left-digits" select="normalize-space($left-digits)"/>
    <xsl:with-param name="right-digits" select="normalize-space($right-
digits)"/>


    <!-- Get the bar/space width pattern -->
    <xsl:with-param name="bar-and-space-widths">
      <xsl:call-template name="get-bar-space-width">
        <xsl:with-param name="value" select="$value"/>
        <xsl:with-param name="code-type" select="$code-type"/>
      </xsl:call-template>
    </xsl:with-param>
    
    <!-- Get the bar height pattern -->
    <xsl:with-param name="bar-heights">
      <xsl:call-template name="get-bar-height">
        <xsl:with-param name="code-type" select="$code-type"/>
      </xsl:call-template>
    </xsl:with-param>

    <!-- Get the width of leading guard bars, in modules -->
    <xsl:with-param name="leading-guards-width">
      <xsl:call-template name="get-leading-guards-width">
        <xsl:with-param name="code-type" select="$code-type"/>
      </xsl:call-template>
    </xsl:with-param>

    <!-- Get the width of trailing guard bars, in modules -->
    <xsl:with-param name="trailing-guards-width">
      <xsl:call-template name="get-trailing-guards-width">
        <xsl:with-param name="code-type" select="$code-type"/>
      </xsl:call-template>
    </xsl:with-param>

    <!-- Get the width of center guard bars, in modules -->
    <xsl:with-param name="center-guards-width">
      <xsl:call-template name="get-center-guards-width">
        <xsl:with-param name="code-type" select="$code-type"/>
      </xsl:call-template>
    </xsl:with-param>

    <!-- Get the width of the left group of short bars, in modules -->
    <xsl:with-param name="left-short-bars-width">
      <xsl:call-template name="get-left-short-bars-width">
        <xsl:with-param name="code-type" select="$code-type"/>
      </xsl:call-template>
    </xsl:with-param>

    <!-- Get the width of the right group of short bars, in modules -->
    <xsl:with-param name="right-short-bars-width">
      <xsl:call-template name="get-right-short-bars-width">
        <xsl:with-param name="code-type" select="$code-type"/>
      </xsl:call-template>
    </xsl:with-param>

    <!-- Get the number of short bars on either right or left side -->
    <xsl:with-param name="short-bars-in-group">
      <xsl:call-template name="count-short-bars-in-group">
        <xsl:with-param name="code-type" select="$code-type"/>
      </xsl:call-template>
    </xsl:with-param>

  </xsl:call-template>

A <xsl:value-of select="$code-type"/> immediatly before this <xsl:call-
template> gives the correct value 'EAN-13'. The first called template in these 
lines 'get-bar-space-width' gets the correct value of $code-type too. The 
others not!! They get the value '70', which is the value of the $height!! I 
tested it that this IS the value of $height by changing lines 161 or 186. Which 
changes 70 to the new value.

Then I got a still more strange behaviour after changing the sequence of 
<xsl:with-param>s. A <xsl:with-param> including an <xsl:call-template> on the 
first position (before 'Dimensional attributes' and 'String components', see 
comments in the snippet above) causes at the first 'Dimensional attribute' 
(here $module) an exception:

Line 266; Column 53; XSLT Error (javax.xml.transform.TransformerException): 
Variable accessed before it is bound!

I hope you can reproduce the bug. I'm using Xalan 2.2.D11. I attach the 
shortest XML-file, the changed bartest-FO.xsl (nothing changed according to 
this bug, but e.g. correct xsl-fo-namespace) and the changed barcode-EAN-
logic.xsl (<xsl:message>s added). I hope you can find a solution for this bug.

Regards,

Joerg