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

Boolean value incorrectly converted to string in attribute value templates

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.10
    • Fix Version/s: CurrentCVS
    • Component/s: XalanC
    • Labels:
      None
    • Environment:
      win-xp-sp2

      Description

      Boolean values are incorrectly converted to string in attribute value templates.
      According to the XSLT specification, "The attribute value template is instantiated by replacing the expression together with surrounding curly braces by the result of evaluating the expression and converting the resulting object to a string as if by a call to the string function".
      Let us assume the following stylesheet:

      <?xml version="1.0" encoding = "ISO-8859-1"?>
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method="xml" omit-xml-declaration="yes"/>
      <xsl:template match="/">
      <BOOL value="

      {true()}

      "/>
      </xsl:template>
      </xsl:stylesheet>

      Normally, the boolean value true should be converted to the string "true", according to the definition of the string() function of XPath.
      However, with XalanC 1.10, this is not the case. The boolean value true is converted to the string "1", and the boolean value false is converted to "0", as if the number() function had been called on the boolean value!
      That is, the output produced is:
      <BOOL value="1"/>
      instead of the expected output:
      <BOOL value="true"/>


      Alain Le Guennec - R&D Expert Engineer
      ESTEREL TECHNOLOGIES
      Mail: Alain.LeGuennec@esterel-technologies.com

        Attachments

        1. patch.patch
          0.6 kB
          David N Bertoni

          Activity

            People

            • Assignee:
              dbertoni David N Bertoni
              Reporter:
              aleguenn@free.fr Alain Le Guennec
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: