Subject: [xsl] Variance between XSLT engines when outputting HTML with a namespa ce From: Jarno.Elovirta@xxxxxxxxx Date: Thu, 6 Sep 2001 07:15:25 +0300 |
Hip hei! Say we have <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/REC-html40"> <xsl:output method="html" indent="yes" encoding="ISO-8859-1" /> <xsl:template match="/"> <html> <head> <title/> </head> <body> <p> <br/> </p> </body> </html> </xsl:template> </xsl:stylesheet> The "HTML 4.01 namespace" shouldn't be there as there are no namespaces in SGML, but J. Clark used it in "Namespaces in XML" [1] and I've seen people use it. Anyhow, the XSLT 1.0/1.1 says "The html output method should not output an element differently from the xml output method unless the expanded-name of the element has a null namespace URI; an element whose expanded-name has a non-null namespace URI should be output as XML. If the expanded-name of the element has a null namespace URI, but the local part of the expanded-name is not recognized as the name of an HTML element, the element should output in the same way as a non-empty, inline element such as span. The html output method should not output an end-tag for empty elements. For HTML 4.0, the empty elements are area, base, basefont, br, col, frame, hr, img, input, isindex, link, meta and param. For example, an element written as <br/> or <br></br> in the stylesheet should be output as <br>." [2] Here's what the XSLT processors on my computer did: output NS omit end-tag jd.xslt 1.1 no yes XT 19991105 yes yes Xalan-J 2.2.D10 yes no MSXML 3 yes no SAXON 6.4.3 yes yes Oracle-J 9.0.2.0.0A Beta yes yes If I've interpreted the spec correctly, Xalan and MSXML are right. Right? Jarno [1] http://www.w3.org/TR/REC-xml-names/ [2] http://www.w3.org/TR/xslt#section-HTML-Output-Method -- A Tank. Dead butch but a bugger to park. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] How to define the XPath e, Ed Steenhoek | Thread | RE: [xsl] Variance between XSLT eng, Michael Kay |
RE: [xsl] How to define the XPath e, Jarno . Elovirta | Date | RE: [xsl] Large Text to Output with, Chris Bayes |
Month |