Ticket #144 (new defect)
XPath problem on finding a SVG element
| Reported by: | aurium | Owned by: | ser |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | XPath | Version: | 3.1.6 |
| Severity: | normal | Keywords: | |
| Cc: | aurium@… | Ruby version: | 1.8.6 |
| Operating system: | Linux |
Description
The /tmp/bola.svg was created with Inkscape. I'm trying to use XPath to simulate the DOM method getElementById.
x = REXML::Document.new( File.new( '/tmp/bola.svg' ) ) => <UNDEFINED> ... </> x.elements[1].elements[5] => <path sodipodi:type='arc' ... id='bola' ... /> x.elements/descendant::*[attribute::id="bola"]? => nil x.elements/descendant::*[@id="bola"]? => nil x.elementsdescendant::*[@id="bola"]? => nil x.elements/descendant::*[@sodipodi:type="arc"]? => <path sodipodi:type='arc' ... id='bola' ... />
So... as you can see we can select elements by some attributes, but not by others. On the last year elements/descendant::*[@id="bola"]? works. There are some regressive bug. I will attach the bola.svg to you test it.
