liaojinxing / firepath

Automatically exported from code.google.com/p/firepath
GNU General Public License v3.0
0 stars 0 forks source link

Sugested xpath not correct for SVG elements (svg, rect, circle, etc) #48

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Go to a page with SVG (ex: 
https://github.com/joao-carloto/FireRobot/graphs/contributors)
2. Click on the first graphic, made with SVG.

What is the expected output? What do you see instead?

The suggested xpath is .//*[@id='contributors-master']/svg, but it does not 
march any element. Something like 
.//*[@id='contributors-master']/*[local-name() = 'svg'] would work.

What version of the product are you using? On what operating system?

Windows7, Firefox 33, Firepath 0.9.7.

An by the way, thanks for the great work. It's been very useful for a long time.

Original issue reported on code.google.com by joao.m.c...@gmail.com on 24 Oct 2014 at 5:16

GoogleCodeExporter commented 9 years ago
Would it be ok for the generated XPath to look like this:
.//*[@id='contributors-master']/svg:svg

This would require registering namespace prefix with the XPath evaluator you 
are using but I believe it is more readable. Also FirePath already support this 
syntax.

Original comment by pierre.t...@gmail.com on 6 Dec 2014 at 10:22

GoogleCodeExporter commented 9 years ago
Yes. That definitely seems to a better solution.

Original comment by joao.m.c...@gmail.com on 7 Dec 2014 at 3:41