Closed Bug 143668 Opened 23 years ago Closed 23 years ago

iterating over nodesets implicitly converted from RTFs fails is some cases

Categories

(Core :: XSLT, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: julian.reschke, Assigned: peterv)

References

()

Details

Attachments

(1 file, 2 obsolete files)

When for-each-iterating though a node-set that was implicitly converted from a RTF, matching by qualified name doesn't seem to work. In my attempt to minimize the problem, I produced: <?xml-stylesheet type="text/xsl" href="moztest.xslt" ?> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:saxon="http://icl.com/saxon" xmlns:test="mailto:julian.reschke@gmx.de" xmlns:msxsl="urn:schemas-microsoft-com:xslt" > <xsl:output method="html" /> <xsl:template match="/"> <html> <head> <title>Mozilla test</title> </head> <body> <xsl:variable name="test"> <xsl:call-template name="fill-var" /> </xsl:variable> <p> <xsl:choose> <xsl:when test="function-available('msxsl:node-set')"> <xsl:variable name="ns" select="msxsl:node-set($test)"/> <xsl:value-of select="count($ns/*)" /> / <xsl:value-of select="count($ns/test:x)" /> </xsl:when> <xsl:when test="function-available('saxon:node-set')"> <xsl:variable name="ns" select="saxon:node-set($test)"/> <xsl:value-of select="count($ns/*)" /> / <xsl:value-of select="count($ns/test:x)" /> </xsl:when> <xsl:otherwise> <xsl:variable name="ns" select="$test"/> <xsl:value-of select="count($ns/*)" /> / <xsl:value-of select="count($ns/test:x)" /> </xsl:otherwise> </xsl:choose> </p> </body> </html> </xsl:template> <xsl:template name="fill-var"> <test:x>1</test:x> <test:x>2</test:x> </xsl:template> </xsl:transform> This displays "2 / 0" rather than "2 / 2.
Attached file test code (obsolete) —
test code produces "Mozilla test / / / 1 2" for me (with 1.2beta on win2k), but I don't understand how this is supposed to work... reporter (Julian): can you try this with a recent build of mozilla and see if it is still a problem? if so, please comment again. if not, please resolve this bug as WORKSFORME. thanks.
the previous testcase was referencing the stylesheet by name, I changed this to "#".
Attachment #83199 - Attachment is obsolete: true
confirmed with 1.0.1, fixed on something after the API landing. I suspect this was fixed by the context landing, guess this was namespaces.
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
1) The problem as initially isolated is gone. 2) However, a similar problem that likely is related still exists (sample code attached, please compare Saxon/MSXML's output with Mozilla's: the sections "status of this memo" and "copyright" are missing)
Status: RESOLVED → UNCONFIRMED
Resolution: FIXED → ---
Comment on attachment 104486 [details] test input and XSLT, compare results using Saxon/MSXML/Mozilla that's not a testcase. 70k stylesheet and 100k source is not going to work.
Attachment #104486 - Attachment is obsolete: true
I *think* that you might need to do something like: $var/node()/* to get all elements in the RTF (i.e. insert an extra "/node()"). The reason is that our RTFs are nodesets containing a single DocumentFragment node in which all actual children lives. Note however that this is hackish and will not work in the future
This indeed works (as a workaround). <p> The best solution would be to become compliant either to XSLT 1.0 (requiring a vendor-specific node-set function that can be discovered using function- available) or XSLT 1.1/2.0 (making RTFs full blown node-sets).
actually, as we decided to move to specs compliance as far as RTFs go, this is INVALID. implicit conversion will die soon, and we hopefully will have a node-set extension function by that time too. /me lifts a leg at one of peterv's trees. Whatever that means
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: