Hi there,
I am truly sorry if the question was asked before, I have
searched but it either seems it was not asked, or I do not use the
right words...
I am trying to deal with group node condition in xpath, ie
xpath like
//div/(descendant::p|descendant::l)[@n='1']
//div/(ns:p|ns:l)[@n='1']
While this seems to be supported in xpath, I cannot find a way to
make it work. My hands are a little tied here because I have not
that much freedom about the xpath in itself, I need to be able to
support a xpath like that, or rather, I can't go with another
simpler route like
//div/p[@n='1'] or //div/l[@n='1']
//ns:div/ns:p[@n='1'] or //ns:div/ns:l[@n='1']
The weird thing is that the following xpath would work
(//tei:l|//tei:p)[@n='1']
But the moment I add something front of it, it breaks.
[node for node in xml.xpath("(//tei:l|//tei:p)[@n='1']",
namespaces={"tei": "
http://www.tei-c.org/ns/1.0"})]
Thank you for your time and help
Best
Thibault