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

Extra attribute inserted when transforming xhtml1-strict file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Resolution: Incomplete
    • 2.0.0
    • None
    • Xalan
    • None
    • Operating System: Other
      Platform: Other
    • 18896

    Description

      When transforming a source file that references the xhtml1-strict DTD
      a "shape" attribute is added to all "a" elements. Only if the DOCTYPE
      declaration is removed does the output appears as expected. This behavior was
      observed with Ant's (1.5.1) xslt task, running on Java 1.4.1.

      === source.xml ===
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

      <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
      <title>Test</title>
      </head>
      <body>
      <p><a href="x">y</a></p>
      </body>
      </html>

      === test.xsl ===
      <?xml version="1.0" encoding="UTF-8"?>

      <xsl:stylesheet
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:html="http://www.w3.org/1999/xhtml"
      xmlns="http://www.w3.org/1999/xhtml"
      version="1.0"
      >
      <xsl:template match="@*|node()">
      <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
      </xsl:copy>
      </xsl:template>
      </xsl:stylesheet>

      === output.xml ===
      <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
      <title>Test</title>
      </head>
      <body>
      <p>
      <a href="x" shape="rect">y</a>
      </p>
      </body>
      </html>

      Attachments

        Activity

          People

            Unassigned Unassigned
            ejain Eric Jain
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: