xsl-list
[Top] [All Lists]

Re: [xsl] An xsl:number problem

2008-07-10 05:45:27
To add some more processors:

Intel XML Software Suite gives:

<?xml version="1.0" encoding="utf-8"?>

<doc nr="0">
    <a mark="true" nr="1"/>
    <a nr="2"/>
    <a nr="3"/>
    <a nr="4"/>
    <a mark="true" nr="5"/>
    <a nr="6"/>
    <a nr="7"/>
    <a nr="8"/>
</doc>

MSXML 3.0 gives:

<?xml version="1.0" encoding="UTF-16"?>
<doc nr="0">
    <a mark="true" nr="0">
</a>
    <a nr="1">
</a>
    <a nr="2">
</a>
    <a nr="3">
</a>
    <a mark="true" nr="0">
</a>
    <a nr="1">
</a>
    <a nr="2">
</a>
    <a nr="3">
</a>
</doc>

Microsoft's .NET 1.0 and .NET 2.0 give

<?xml version="1.0" encoding="utf-8"?>
<doc nr="">
    <a mark="true" nr=""></a>
    <a nr="1"></a>
    <a nr="2"></a>
    <a nr="3"></a>
    <a mark="true" nr=""></a>
    <a nr="1"></a>
    <a nr="2"></a>
    <a nr="3"></a>
</doc>

and respectively

<?xml version="1.0" encoding="utf-8"?>
<doc nr="">
    <a mark="true" nr="" />
    <a nr="1" />
    <a nr="2" />
    <a nr="3" />
    <a mark="true" nr="4" />
    <a nr="1" />
    <a nr="2" />
    <a nr="3" />
</doc>

Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Michael Ludwig wrote:
Michael Kay schrieb:
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 changed the version to "1.0".

I would be interested to know what other XSLT 1.0 or 2.0 processors do
with this one.

Here's the output for xsltproc/LibXSLT 1.1.22:

<?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>

For Xalan-C 1.10:

<?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>

And for Xalan-J 2.7.1:

<?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.

Michael Ludwig

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>