PathExpr::matches is broken if the path contains //

VERIFIED FIXED

Status

()

Core
XSLT
VERIFIED FIXED
17 years ago
17 years ago

People

(Reporter: sicking, Assigned: sicking)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

PathExpr is broken if any of the contained steps uses an ANCESTOR_OP (//).

Consider for example the following pattern:

"foo/bar//baz"

We first need to check if the 'baz' part matches, then we need to walk up the 
tree until we find a node that matches 'bar'. If the next node up the tree is 
not an 'foo' we need to continue looking for another 'bar' to see if that has 
a 'foo' parent.
I think I can come up with a patch for this but I need bug 85189 checked in 
first.
Status: NEW → ASSIGNED
Depends on: 85189

Comment 2

17 years ago
This one is solved.

Axel

No, I'm not bored.
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED

Comment 3

17 years ago
Created attachment 43501 [details]
attaching style sheet for verification

Comment 4

17 years ago
Created attachment 43502 [details]
xml file for verification, uses above stylesheet
nope, it dosn't work if there is a element that matches "bar" but it's parent 
dosn't match "foo"...

(untested) testcase coming up
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Created attachment 43503 [details]
xml that dosn't work, uses above stylesheet

Comment 7

17 years ago
fight!

If I understand your xml correctly, your example is supposed to dump
<out>
   right
</out>
as well, huh?
It does, buddy.
(my testcase had two bar elements, so it wouldn't match for/bar/baz either)

Axel
Status: REOPENED → RESOLVED
Last Resolved: 17 years ago17 years ago
Resolution: --- → FIXED
shit!

ok. but it's not optimized
this actually worked all along, and the code is rewritten now anyways
Status: RESOLVED → VERIFIED

Comment 10

17 years ago
Comment on attachment 43501 [details]
attaching style sheet for verification

Fixing mime type ...
Attachment #43501 - Attachment mime type: text/xml → text/xsl
Comment on attachment 43501 [details]
attaching style sheet for verification

Bah. text/xsl does not exist as a mime type, if you try to fix things, at least
make sure you're right.
Attachment #43501 - Attachment mime type: text/xsl → text/xml
You need to log in before you can comment on or make changes to this bug.