Closed
Bug 72810
Opened 25 years ago
Closed 24 years ago
count() function is unable to handle certain path expressions
Categories
(Core :: XSLT, defect, P2)
Core
XSLT
Tracking
()
VERIFIED
FIXED
mozilla0.9.2
People
(Reporter: wschmid, Assigned: peterv)
Details
(Keywords: testcase, Whiteboard: Fix in hand. Have r=sicking, sr=jst. Need a=.)
Attachments
(8 files)
|
191 bytes,
text/plain
|
Details | |
|
518 bytes,
text/plain
|
Details | |
|
71 bytes,
text/plain
|
Details | |
|
7.42 KB,
patch
|
Details | Diff | Splinter Review | |
|
8.04 KB,
patch
|
Details | Diff | Splinter Review | |
|
9.73 KB,
patch
|
Details | Diff | Splinter Review | |
|
9.78 KB,
patch
|
Details | Diff | Splinter Review | |
|
9.26 KB,
patch
|
Details | Diff | Splinter Review |
See attached XML/XSL files.
| Reporter | ||
Comment 1•25 years ago
|
||
| Reporter | ||
Comment 2•25 years ago
|
||
| Reporter | ||
Comment 3•25 years ago
|
||
| Reporter | ||
Updated•25 years ago
|
Keywords: mozilla0.8,
testcase
Comment 4•25 years ago
|
||
This works fine up to the point where we try to evaluate the argument to the
count() function.
The reason for this problem seems to be the context node, which is the
xsl:variable node. Heck, that's part of the stylesheet, that can't be right, hu?
But what is the right context node? This is called from processTopLevel, and I
poked the spec without any luck about what the context node should be, as we
don't instantiate any template yet. Should we take the source doc in this case?
stack trace: (for a slightly modified version, using a select attribute)
#0 NodeSetFunctionCall::evaluate (this=0xb1e00, context=0xb4fa0,
cs=0xffbef3c0)
at
/home/ah/source/XSLT/thirdtree/mozilla/extensions/transformiix/source/xpath/NodeSetFunctionCall.cpp:95
#1 0x87598 in XSLTProcessor::processVariable (this=0xffbef8b0, node=0xb4fa0,
xslVariable=0xb4fa0, ps=0xffbef3c0)
at
/home/ah/source/XSLT/thirdtree/mozilla/extensions/transformiix/source/xslt/XSLTProcessor.cpp:1603
#2 0x8268c in XSLTProcessor::processTopLevel (this=0xffbef8b0,
stylesheet=0xb1da0, ps=0xffbef3c0)
at
/home/ah/source/XSLT/thirdtree/mozilla/extensions/transformiix/source/xslt/XSLTProcessor.cpp:493
#3 0x81dc4 in XSLTProcessor::processTopLevel (this=0xffbef8b0,
xslDocument=0xb14f8, ps=0xffbef3c0)
at
/home/ah/source/XSLT/thirdtree/mozilla/extensions/transformiix/source/xslt/XSLTProcessor.cpp:379
#4 0x82c94 in XSLTProcessor::process (this=0xffbef8b0, xmlDocument=@0xaf458,
xslDocument=@0xb14f8, out=@0xab8c0)
at
/home/ah/source/XSLT/thirdtree/mozilla/extensions/transformiix/source/xslt/XSLTProcessor.cpp:595
#5 0x8329c in XSLTProcessor::process (this=0xffbef8b0, xmlInput=@0xae938,
xmlFilename=@0xae318, xslInput=@0xffbef780, xslFilename=@0xae330,
out=@0xab8c0)
at
/home/ah/source/XSLT/thirdtree/mozilla/extensions/transformiix/source/xslt/XSLTProcessor.cpp:680
#6 0x8c58c in main (argc=5, argv=0xffbef98c)
at
/home/ah/source/XSLT/thirdtree/mozilla/extensions/transformiix/source/main/transformiix.cpp:135
Comment 5•25 years ago
|
||
doing milestone, and partially keywords that didn't survive midair. My
stacktrace wins ;-)
Keywords: testcase
Target Milestone: --- → mozilla0.9
This should be fixed with the new parser
Depends on: 75102
ignore me :(
No longer depends on: 75102
The context node and context node list should be the rootnode of the source
document per http://www.w3.org/TR/xslt#top-level-variables
Comment 9•25 years ago
|
||
Yep XSLTProcessor::processTopLevel is definately wrong, the source document node
should be passed in as a parameter:
something like:
processTopLevel(Document* source, Document* stylesheet, ProcessorState* ps);
-and-
processTopLevel(Document* source, Element* stylesheet, ProcessorState* ps);
then lines 423 and 503 both need to be changed to:
ExprResult* exprResult = processVariable(source, node, ps);
and line 565 should be changed to:
processTopLevel(&xmlDocument, &xslDocument, &ps);
That should fix it.
--Keith
Status: NEW → ASSIGNED
Comment 10•25 years ago
|
||
Are you still shooting for 0.9 on this? If so please email drivers@mozilla.org
with a status on you progress. If not please retarget against a later Milestone.
Thanks.
Comment 12•25 years ago
|
||
is this on track for landing in the next week or so?
if not lets unset the target milestone until we get a good plan in place.
| Assignee | ||
Comment 13•24 years ago
|
||
I'll try out the suggestion and make a patch.
Assignee: kvisco → peterv
Status: ASSIGNED → NEW
Target Milestone: mozilla0.9.1 → mozilla0.9.2
| Assignee | ||
Updated•24 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P2
| Assignee | ||
Comment 14•24 years ago
|
||
| Assignee | ||
Comment 15•24 years ago
|
||
I just copied what Keith wrote (with some clean-up). Seems to work :).
| Assignee | ||
Comment 16•24 years ago
|
||
We need both processTopLevel functions, the one that takes an element is needed
for embedded stylesheets (spec section 2.7) and the one that takes a document
is a great place to support LRE stylesheets (spec section 2.3)
Also would you mind setting the context nodeset and xslt-current node so that
we get the following variables right?
<xsl:variable select="position()"/>
<xsl:variable select="last()"/>
<xsl:variable select="current()"/>
The context nodeset should be a nodeset containing only the root-node of the
source document
Comment 18•24 years ago
|
||
/me tries to scare peterv.
Could a embedded stylesheet be a 2.3 LRE? It doesn't say so in 2.7, but ???
Axel
| Assignee | ||
Comment 19•24 years ago
|
||
Comment 20•24 years ago
|
||
r=me, once you add NS_ASSERTION for aStylesheet, too.
The documentElement stuff can be done either here, or in 85408, whichever
Axel
ugh, I hate to do this, but I still have a complaint :(
Why do the push/pop for every variable and not just once around the initial
call to processTopLevel. That way we would also get the right current nodelist
for the initial templatematching.
Also, it's the sourcedocs root-node that should be the current node and context
nodelist, not it's documentelement.
| Assignee | ||
Comment 22•24 years ago
|
||
/me slaps peterv
what part of "root-node" don't you understand ;)
instead of
+ sourceRoot = sourceDocument->getFirstChild();
+ NS_ASSERTION(sourceRoot, "source document has no root node");
+ if (sourceRoot) {
+ nodeSet.add(sourceRoot);
+ ps->pushCurrentNode(sourceRoot);
+ }
just do
+ nodeSet.add(sourceDocument);
+ ps->pushCurrentNode(sourceDocument);
:)
other then that, r=sicking
| Assignee | ||
Comment 24•24 years ago
|
||
:). Right, right. I think I'll go have some sleep now.
Whiteboard: Fix in hand. Have r=sicking. Need sr=, a=.
| Assignee | ||
Comment 25•24 years ago
|
||
Comment 26•24 years ago
|
||
sr=jst
| Assignee | ||
Updated•24 years ago
|
Whiteboard: Fix in hand. Have r=sicking. Need sr=, a=. → Fix in hand. Have r=sicking, sr=jst. Need a=.
a=roc on behalf of drivers
| Assignee | ||
Comment 28•24 years ago
|
||
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•