Subject: Re: [xsl] An xsl:number problem From: Michael Ludwig <mlu@xxxxxxxxxxxxx> Date: Thu, 10 Jul 2008 11:47:18 +0200 |
I've raised a bug report against the spec on this one, but I would be interested to know how various processors handle it. Please try it and report the results. The bug report is at
http://www.w3.org/Bugs/Public/show_bug.cgi?id=5849
Stylesheet:
<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
I would be interested to know what other XSLT 1.0 or 2.0 processors do with this one.
<?xml version="1.0"?> <doc nr="0"> <a mark="true" nr="1"/> <a nr="2"/> <a nr="3"/> <a nr="4"/> <a mark="true" nr="1"/> <a nr="2"/> <a nr="3"/> <a nr="4"/> </doc>
<?xml version="1.0" encoding="UTF-8"?> <doc nr="0"> <a mark="true" nr="0"/> <a nr="2"/> <a nr="3"/> <a nr="4"/> <a mark="true" nr="0"/> <a nr="6"/> <a nr="7"/> <a nr="8"/> </doc>
<?xml version="1.0" encoding="UTF-8"?><doc nr="0"> <a mark="true" nr="0"/> <a nr="2"/> <a nr="3"/> <a nr="4"/> <a mark="true" nr="0"/> <a nr="6"/> <a nr="7"/> <a nr="8"/> </doc>
I think the intuitively correct result is:
<?xml version="1.0" encoding="UTF-8"?> <doc nr=""> <a mark="true" nr="1"/> <a nr="2"/> <a nr="3"/> <a nr="4"/> <a mark="true" nr="1"/> <a nr="2"/> <a nr="3"/> <a nr="4"/> </doc>
Do you agree?
LibXSLT's output is better, I'd say, as it generates a "0" on <doc>, which I find more intuitive as a number than an empty string.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] An xsl:number problem, XemonerdX | Thread | Re: [xsl] An xsl:number problem, George Cristian Bina |
Re: [xsl] An xsl:number problem, XemonerdX | Date | Re: [xsl] Validation XSLT using XSL, Ganesh Babu N |
Month |