[ http://nagoya.apache.org/jira/browse/XALANJ-1685?page=history ]
Henry Zongaro updated XALANJ-1685:
----------------------------------
Priority: Major (was: Blocker)
> Redirect produces duplicate document type declaration
> -----------------------------------------------------
>
> Key: XALANJ-1685
> URL: http://nagoya.apache.org/jira/browse/XALANJ-1685
> Project: XalanJ2
> Type: Bug
> Components: Xalan-extensions
> Versions: 2.5
> Environment: Operating System: Linux
> Platform: PC
> Reporter: Matthew Haas
>
> Input XML:
> <?xml version="1.0" encoding="UTF-8"?>
> <site-map>
> <pages>
> <page>
> <id>page-1</id>
> </page>
> <page>
> <id>page-2</id>
> </page>
> </pages>
> </site-map>
> XSLT:
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:redirect="http://xml.apache.org/xalan/redirect"
> extension-element-prefixes="redirect">
>
> <xsl:output
> method="html"
> version="4.01"
> indent="yes"
> encoding="UTF-8"
> doctype-system="http://www.w3.org/TR/html4/strict.dtd"
> doctype-public="-//W3C//DTD HTML 4.01//EN"
> />
>
> <xsl:template match="/">
> <xsl:apply-templates select="//page"/>
> </xsl:template>
>
> <xsl:template match="page">
> <redirect:write select="concat(id, '.html')">
> <HTML lang="en">
> <BODY>
> <xsl:value-of select="id"/>
> </BODY>
> </HTML>
> </redirect:write>
> </xsl:template>
> </xsl:stylesheet>
> Produces these output files:
> cat page-1.html
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "http://www.w3.org/TR/html4/strict.dtd">
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "http://www.w3.org/TR/html4/strict.dtd">
> <HTML lang="en">
> <BODY>page-1</BODY>
> </HTML>
> cat page-2.html
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "http://www.w3.org/TR/html4/strict.dtd">
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "http://www.w3.org/TR/html4/strict.dtd">
> <HTML lang="en">
> <BODY>page-2</BODY>
> </HTML>
> Note the two doctype tags.
> This bug seems to of appeared between Xalan versions 2.4.1 and 2.5.1.
> I'm working round the bug at the moment by passing the output through sed to
> remove the first line.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]