DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23817>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23817 Redirect produces duplicate document type declaration Summary: Redirect produces duplicate document type declaration Product: XalanJ2 Version: 2.5 Platform: PC OS/Version: Linux Status: NEW Severity: Normal Priority: Other Component: org.apache.xalan.processor AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] 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.
