curcuru     01/10/17 13:11:05

  Added:       test/tests/bugzilla Bugzilla4218a.xsl Bugzilla4218.xsl
  Log:
  Reproduce both halves of Bugzilla#4218
  
  Revision  Changes    Path
  1.1                  xml-xalan/test/tests/bugzilla/Bugzilla4218a.xsl
  
  Index: Bugzilla4218a.xsl
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  <xsl:stylesheet 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    version="1.0">   
  <!-- Reproduce Bugzilla#4218, apply this to identity.xml or any file -->  
  <!--
  The following stylesheet puts out <out>abcabc</out>, which is absolutely
  incorrect.  If you uncomment the commented value-of and variable, it results
  "Variable accessed before it is bound!" error message.  The bug seems to be
  related to the inner call-template... it looks like something in the stack
  frame is not being restored???
  -->
  <xsl:template match="/">
      <out>
        <xsl:variable name="v1" select="'abc-should-appear-once'"/>
        <xsl:variable name="v2" select="'def-should-appear-once'"/>
       
        <!-- Comment this in, along with the value-of below,
             to get error message: Variable accessed before it is bound! 
             See Bugzilla4218.xsl -->
        <xsl:variable name="v3" select="'ghi-should-appear-once'"/>
       
        <xsl:call-template name="test-template">
          <xsl:with-param name="p1">
            <xsl:call-template name="xyz-template">
              <xsl:with-param name="p1" select="$v1"/>
            </xsl:call-template>
            <xsl:value-of select="$v2"/>
            <!-- Comment this in along with the v3 variable above to
                 get error message! See Bugzilla4218.xsl -->
            <xsl:value-of select="$v3"/>
          </xsl:with-param>
        </xsl:call-template>
      </out>
    </xsl:template>
   
    <xsl:template name="test-template">
      <xsl:param name="p1" select="'error'"/>
      <test-template><xsl:value-of select="$p1"/></test-template>
    </xsl:template>
   
    <xsl:template name="xyz-template">
      <xsl:param name="p1" select="'error'"/>
      <xyz-template><xsl:value-of select="$p1"/></xyz-template>
    </xsl:template>
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/test/tests/bugzilla/Bugzilla4218.xsl
  
  Index: Bugzilla4218.xsl
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>
  <xsl:stylesheet 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    version="1.0">   
  <!-- Reproduce Bugzilla#4218, apply this to identity.xml or any file -->  
  <!--
  The following stylesheet puts out <out>abcabc</out>, which is absolutely
  incorrect.  If you uncomment the commented value-of and variable, it results
  "Variable accessed before it is bound!" error message.  The bug seems to be
  related to the inner call-template... it looks like something in the stack
  frame is not being restored???
  -->
  <xsl:template match="/">
      <out>
        <xsl:variable name="v1" select="'abc-should-appear-once'"/>
        <xsl:variable name="v2" select="'def-should-appear-once'"/>
       
        <xsl:variable name="v3" select="'ghi-should-appear-once'"/>
       
        <xsl:call-template name="test-template">
          <xsl:with-param name="p1">
            <xsl:call-template name="xyz-template">
              <xsl:with-param name="p1" select="$v1"/>
            </xsl:call-template>
            <xsl:value-of select="$v2"/>
            <!-- Comment this in, to get error message: 
                 Variable accessed before it is bound! 
                 See Bugzilla4218a.xsl -->
            <!-- xsl:value-of select="$v3"/ -->
          </xsl:with-param>
        </xsl:call-template>
      </out>
    </xsl:template>
   
    <xsl:template name="test-template">
      <xsl:param name="p1" select="'error'"/>
      <test-template><xsl:value-of select="$p1"/></test-template>
    </xsl:template>
   
    <xsl:template name="xyz-template">
      <xsl:param name="p1" select="'error'"/>
      <xyz-template><xsl:value-of select="$p1"/></xyz-template>
    </xsl:template>
  </xsl:stylesheet>
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to