GNOME Bugzilla – Bug 138220
Unterminated meta elements in HTML output using xsl:document
Last modified: 2009-08-15 18:40:50 UTC
Create the following files: a.dtd: <!ELEMENT a (b*)> <!ELEMENT b (#PCDATA)> a.xml: <?xml version="1.0"?> <!DOCTYPE a SYSTEM "a.dtd"> <a> <b>B1</b> <b>B2</b> <b>B3</b> </a> a.xsl: <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" indent="yes" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" encoding="iso-8859-1" omit-xml-declaration = "yes"/> <xsl:template match="/"> <html> <head> <meta name="generator" content="a.xsl"/> <title>Index</title> </head> <body> <h1>Index</h1> <ul> <xsl:for-each select="//b"> <li><xsl:value-of select="."/></li> <xsl:call-template name="subdoc"/> </xsl:for-each> </ul> </body> </html> </xsl:template> <xsl:template name="subdoc"> <xsl:document href="{concat(.,'.html')}" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" encoding="iso-8859-1" indent="yes"> <html> <head> <meta name="generator" content="a.xsl"/> <title><xsl:value-of select="."/></title> </head> <body> <h1><xsl:value-of select="."/></h1> </body> </html> </xsl:document> </xsl:template> </xsl:stylesheet> Do: xsltproc a.xsl a.xml > index.html The meta elements in index.html are terminated correctly, but those in B{1,2,3}.html, generated using xsl:document, are not.
Sorry for a rather slow response to this report. Your xsl:document is creating documents with output filename *.html. By default, that will force the output method to be "html", and that in turn will cause the <meta> to be output without a closing tag. In order to make it behave in the way you want, include the attribute method="xml" within the xsl:document. Bill