Closed
Bug 70865
Opened 24 years ago
Closed 24 years ago
LocationStep isn't attributefriendly
Categories
(Core :: XSLT, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: sicking, Assigned: sicking)
References
Details
Attachments
(3 files)
|
3.55 KB,
patch
|
Details | Diff | Splinter Review | |
|
3.75 KB,
patch
|
Details | Diff | Splinter Review | |
|
6.24 KB,
patch
|
Details | Diff | Splinter Review |
While walking the tree LocationStep isn't attribute frienly. In many places it
does |node = node->getParentNode()| where node could be an attribute. It should
rather do |node = cs->getParentNode(node)| .
Also the code for following:: (and preceding::) has bugs. There is an |if| that
checks if the current node is the last sibling and if so walks to the parent
following sibling. However the parent may also be the last sibling so we need a
|while| rather then an |if|
attaching a patch to fix
| Assignee | ||
Comment 1•24 years ago
|
||
| Assignee | ||
Comment 2•24 years ago
|
||
the attached patch dosn't work... will attach new version once I have some more
fixes in
| Assignee | ||
Comment 3•24 years ago
|
||
| Assignee | ||
Comment 4•24 years ago
|
||
the attached patch passes almost all axes tests in buster. The remaing ones I
afaict are problems with either whitespace or attribute order. Note that this
depends on bug 70979 for module
| Assignee | ||
Comment 5•24 years ago
|
||
| Assignee | ||
Comment 6•24 years ago
|
||
The patch fixes the following things:
1. The old code didn't work when the contextnode was an attribute. According to
the XPath datamodel the parent of an attribute is it's element so we need to
use the ContextState::getParentNode(Node*) function rather then
Node::getParentNode() when trying to find the parent
2. The FOLLOWING and PRECEDING axes were very broken
3. LocationStep::matches didn't calculate the correct context nodeset when
evaluating the predicates
Comment 7•24 years ago
|
||
Comment 8•24 years ago
|
||
+ NodeSet* nodes = (NodeSet*)evaluate(cs->getParentNode(node),cs);
+ result = nodes->contains(node);
Can evaluate return null? If so, you might want to defend against it.
Other than that, sr=shaver.
Comment 9•24 years ago
|
||
fix checked in
Axel
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
•