Closed
Bug 440974
Opened 16 years ago
Closed 16 years ago
Unneeded <transformiix:root /> elements as a result of XSL transformation.
Categories
(Core :: XSLT, defect, P3)
Core
XSLT
Tracking
()
RESOLVED
FIXED
mozilla1.9.1b1
People
(Reporter: algorkov, Assigned: peterv)
Details
Attachments
(3 files, 1 obsolete file)
1.66 KB,
text/html
|
Details | |
2.98 KB,
patch
|
peterv
:
review+
peterv
:
superreview+
|
Details | Diff | Splinter Review |
1.05 KB,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0
Unneeded <transformiix:root /> elements appear after XSL transformation performed by XSLTProcessor.transformToDocument() method. It is not a wrapping <transformiix:root /> root element that is added to form valid XML document, but unneeded <transformiix:root /> elements wrapping child nodes of the resulting document.
Reproducible: Always
Steps to Reproduce:
1. XML document:
<?xml version="1.0"?>
<items>
<item>
<id>1</id>
</item>
<item>
<id>2</id>
</item>
<item>
<id>3</id>
</item>
</items>
2. XSL stylesheet:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" />
<xsl:template match="item">
<tr id="{id}">
<td>
<xsl:value-of select="id" />
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
3. Load these XML and XSL documents to Document instances.
4. Transform this XML document using given XSL stylesheet with the following code:
var processor = new XSLTProcessor();
processor.importStylesheet(xslDoc);
var doc = processor.transformToDocument(xmlDoc);
Actual Results:
<transformiix:result xmlns:transformiix="http://www.mozilla.org/TransforMiix">
<transformiix:result>
<TR id="1">
<TD>1</TD>
</TR>
<TR id="2">
<TD>2</TD>
</TR>
</transformiix:result>
<TR id="3">
<TD>3</TD>
</TR>
</transformiix:result>
There is unexpected <transformiix:result /> element wrapping first two <tr /> elements in the resulting document.
Expected Results:
<transformiix:result xmlns:transformiix="http://www.mozilla.org/TransforMiix">
<TR id="1">
<TD>1</TD>
</TR>
<TR id="2">
<TD>2</TD>
</TR>
<TR id="3">
<TD>3</TD>
</TR>
</transformiix:result>
With an increase of the number of items in the original XML document we get increase in nesting of <transformiix:result /> elements. For example with four <item /> elements I got:
<transformiix:result xmlns:transformiix="http://www.mozilla.org/TransforMiix">
<transformiix:result>
<transformiix:result>
<TR id="1">
<TD>1</TD>
</TR>
<TR id="2">
<TD>2</TD>
</TR>
</transformiix:result>
<TR id="3">
<TD>3</TD>
</TR>
</transformiix:result>
<TR id="4">
<TD>4</TD>
</TR>
</transformiix:result>
Comment 1•16 years ago
|
||
Dear colleagues,
I have the same problem in Windows XP SP 3
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0
Could anybody decide is it a feature of FF 3 or is it a bug?
Attaching a testcase or at least providing a link increases your chances of someone looking at your bug report...
Component: General → XSLT
Product: Firefox → Core
QA Contact: general → xslt
Version: unspecified → Trunk
OS: Windows Vista → All
Hardware: PC → All
Comment 3•16 years ago
|
||
It is very interesting how long bug can have status UNCONFIRMED. When I post any issue to Microsoft it works more faster. Can anybody decide is it the issue or not?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 4•16 years ago
|
||
Another Firefox workaround needed guys? In order to get more-or-less
consistent output with the browsers I tested this example on, I needed XSLT
something like this:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" />
<xsl:template match="items">
<table>
<xsl:for-each select="item">
<tr><xsl:apply-templates/></tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
or this --
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" />
<xsl:template match="items">
<tr id="{id}">
<xsl:for-each select="item">
<td align="left"><xsl:apply-templates/></td>
</xsl:for-each>
</tr>
</xsl:template>
</xsl:stylesheet>
But is it necessary that everyone do a workaround?
Assignee | ||
Comment 5•16 years ago
|
||
Still need to automate testcase.
Assignee: nobody → peterv
Status: NEW → ASSIGNED
Comment on attachment 337056 [details] [diff] [review]
v1
Yes, please do write tests as well.
Attachment #337056 -
Flags: superreview+
Attachment #337056 -
Flags: review+
Assignee | ||
Comment 7•16 years ago
|
||
Same as attachment 337056 [details] [diff] [review], but with mochitest. Carrying over r/sr=sicking.
Attachment #337056 -
Attachment is obsolete: true
Attachment #337461 -
Flags: superreview+
Attachment #337461 -
Flags: review+
Assignee | ||
Updated•16 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Flags: in-testsuite+
Priority: -- → P3
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1b1
Comment 8•16 years ago
|
||
Sorry for my ignorance about bugzilla, but where is this fixed?
I'm trying to work out why our XML files don't process properly in firefox 3.0.6 (but do in IE, & xsltproc). I used the Firefox XSLT Results addin, which showed me that for some reason, there is a ridiculously large number of <transformiix:result> tags in our processed document.
So I'm working in Firefox 39.0a2 and this is still not fixed.
This should not be marked as resolved.
Assignee | ||
Comment 10•10 years ago
|
||
You'll have to file a new bug with a testcase. The bug as filed (see testcase in comment 0) was fixed.
Comment 11•10 years ago
|
||
The test case attached to this bug fails in 39.0a2, with a few changes. I have attached my new version of the test case. I don't see the point of opening a new bug for exactly the same problem.
Comment 12•10 years ago
|
||
Assignee | ||
Comment 13•10 years ago
|
||
(In reply to jwuertz from comment #11)
> The test case attached to this bug fails in 39.0a2, with a few changes.
It doesn't fail for me, it shows: <transformiix:result xmlns:transformiix="http://www.mozilla.org/TransforMiix"><tr xmlns="http://www.w3.org/1999/xhtml" id="1"><td>1</td></tr><tr xmlns="http://www.w3.org/1999/xhtml" id="2"><td>2</td></tr><tr xmlns="http://www.w3.org/1999/xhtml" id="3"><td>3</td></tr><tr xmlns="http://www.w3.org/1999/xhtml" id="4"><td>4</td></tr></transformiix:result>
> I don't see the point of
> opening a new bug for exactly the same problem.
The original problem was fixed in this bug, reopening is just going to add noise as any new problems probably have a different cause. If you are seeing multiple transformiix:result elements then please open a new bug.
You need to log in
before you can comment on or make changes to this bug.
Description
•