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

xsl:strip-space element doesn't work proprely

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: CurrentCVS
    • Fix Version/s: CurrentCVS
    • Component/s: XalanC
    • Labels:
      None
    • Environment:
      all

      Description

      for the input file:
      <?xml version="1.0" encoding="ISO-8859-1" ?>
      <foo>
      <boo>
      </boo>
      </foo>
      and a stylesheet:
      <?xml version="1.0" encoding="UTF-8"?>
      <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

      <xsl:strip-space elements="*" />

      <xsl:template match="*">
      <xsl:if test=" . != '' " >
      <xsl:text>for a node:</xsl:text><xsl:value-of select="name(.)"/><xsl:text>
      The length is</xsl:text>
      <xsl:value-of select="string-length(.)"/> <xsl:text>
      </xsl:text>

      <xsl:apply-templates/>

      </xsl:if>
      </xsl:template>

      <xsl:template match="/">
      <out>
      <xsl:apply-templates/>
      </out>
      </xsl:template>

      </xsl:stylesheet>

      The expected output would be :
      <?xml version="1.0" encoding="utf-8"?><out/>
      But XalanC gives:
      <?xml version="1.0" encoding="UTF-8"?><out>for a node: foo
      The length is 3
      for a node: boo
      The length is 1
      </out>

        Attachments

          Activity

            People

            • Assignee:
              dbertoni David N Bertoni
              Reporter:
              dmitryh Dmitry Hayes
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: