[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] <xsl:number from=...> different behavior (MSXML3 vs sa
I found a problem about interpretation of <xsl:number from=...>. See the following example. --------------- test.xsl ------------------------ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <html> <body> <xsl:apply-templates/> </body> </html> </xsl:template> <xsl:template match="part/title"> <h1> <xsl:number from="book" count="part" level="any" format="I"/> <xsl:text> </xsl:text> <xsl:apply-templates/> </h1> </xsl:template> <xsl:template match="chapter/title"> <h2> <xsl:number from="part" count="chapter" level="any" format="1"/> <xsl:text> </xsl:text> <xsl:apply-templates/> </h2> </xsl:template> </xsl:stylesheet> ------------------------------------------------- This test.xsl works well for documents having both <part> and <chapter>, but if there is no <part> elements, what should be returned by <xsl:number from="part" .../>? (The XSLT spec seems unclear about this) --------------- test.xml ------------------------ <book> <chapter><title>Uno</title> ... </chapter> <chapter><title>Dos</title> ... </chapter> <chapter><title>Tres</title> ... </chapter> <chapter><title>Cuatro</title> ... </chapter> </book> ------------------------------------------------- --------------- MSXML3 output ------------------------ <html> <body> <h2>0 Uno</h2> ... <h2>0 Dos</h2> ... <h2>0 Tres</h2> ... <h2>0 Cuatro</h2> ... </body> </html> ------------------------------------------------------ --------------- SAXON output ------------------------ <html> <body> <h2>1 Uno</h2> ... <h2>2 Dos</h2> ... <h2>3 Tres</h2> ... <h2>4 Cuatro</h2> ... </body> </html> ----------------------------------------------------- Which is correct? ~~Shinyu XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|