I tried with “style” attribut of tag, but I return me 4 elements matched : //*[local-name()="tspan" and @style="fill:#DDDF0D; opacity: 0.3"]/parent::*//following-sibling::*[local-name()="tspan"][1]
Is there some way to have a xpath to Emetteurs Zone 1: of the first element ?
The following XPath will NOT select a SVG tspan element:
Possibly, it should rather be:
//*[local-name()="tspan" and @style="fill:#DDDF0D; opacity: 0.3"]//following-sibling::*[local-name()="tspan" and position()=1]
I mean, you need to repeat writing “*[local-name="svg element name" ...” for every single layer of SVG element path.
Consequently any XPath expression for an element under the <svg xmlns="http://www.w3.org/2000/svg"> element embedded in a <html> will become very long, which is inevitable.
cool, that’ll work with this one //*[local-name()="tspan" and @style="fill:#DDDF0D; opacity: 0.3"]//following-sibling::*[local-name()="tspan" and position()=1]
I see what you say about the xpath but It’s OK, at least I understand how to rewrite this xpath.