Uploaded image for project: 'XalanJ2'
  1. XalanJ2
  2. XALANJ-411

xsltc fails conf test ouput37 escaping & in an attribute value

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Resolution: Fixed
    • 2.0.0
    • None
    • XSLTC
    • Security Level: No security risk; visible to anyone (Ordinary problems in Xalan projects. Anybody can view the issue.)
    • None
    • Operating System: All
      Platform: All
    • 3003

    Description

      According to Section B.7.1 HTML 4.0 Recommendation, an "&" should not be escaped
      when occuring in an attribute value. xsltc incorrectly escapes the & in an
      attribute value in HTML output.

      The expected output should have

      <Body bgcolor="&

      {randomrbg};"></Body>

      Whereas, xsltc's output has

      <Body bgcolor="&{randomrbg}

      ;"></Body>

      XSL
      ===
      <?xml version="1.0"?>
      <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:output method="html"
      doctype-public="-//W3C//DTD HTML 4.0 Transitional"/>

      <!-- FileName: OUTP37 -->
      <!-- Document: http://www.w3.org/TR/xslt -->
      <!-- DocVersion: 19991116 -->
      <!-- Section: 16.2 HTML Output Method -->
      <!-- Purpose: "&" should not be escaped when occuring in an attribute value
      immediately followed by a "{". See to Section B.7.1 HTML 4.0
      Recommendation. -->

      <xsl:template match="/">
      <HTML>
      <Body bgcolor='&randomrbg;'/>
      </HTML>
      </xsl:template>

      </xsl:stylesheet>

      Attachments

        Activity

          People

            Unassigned Unassigned
            tom.amiro@sun.com Tom Amiro
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: