Uploaded image for project: 'XalanC'
  1. XalanC
  2. XALANC-416

Wrong access to out-of-scope xsl:variable not detected in certain circumstances

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 1.7
    • Fix Version/s: None
    • Component/s: XalanC
    • Labels:
      None
    • Environment:
      Operating System: Windows NT/2K
      Platform: PC
    • Bugzilla Id:
      29079

      Description

      In the following very short stylesheet,
      Template2 is refering to variable 'OutOfScope'
      which is declared locally within Template1, not Template2.
      This error goes undetected by XalanC version 1.7.0.
      Note that if the declaration of variable "result"
      surrounding the call to Template2 is removed,
      that is, Template2 is called directly within Template1,
      then Xalan complains that variable 'OutOfScope' is not defined.

      <?xml version="1.0" encoding = "ISO-8859-1"?>
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

      <xsl:template name="Template1" match="/">
      <xsl:variable name="OutOfScope" select="."/>
      <xsl:variable name="result">
      <xsl:call-template name="Template2"/>
      </xsl:variable>
      <xsl:copy-of select="$result"/>
      </xsl:template>

      <xsl:template name="Template2">
      <xsl:copy-of select="$OutOfScope"/><!-- ALG: This variable should not be
      visible, should it? -->
      </xsl:template>

      </xsl:stylesheet>

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              aleguenn@free.fr Alain Le Guennec

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment