
Hi Thibault, On Wed, 25 Nov 2015 14:22:20 +0100 Thibault Clerice <leponteineptique@gmail.com> wrote:
[...] 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']
I'm not 100% sure, but I guess this XPath expression is only supported in XPath 1.0.
While this seems to be supported in xpath,
... only in XPath 2.0 if I'm not mistaken.
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
You can always "resolve" the group which should work: //div/descendant::p[@n='1'] | //div/descendant::l[@n='1'] I know, it's a little bit verbose. But maybe you optimize it with some lxml and Python magic.
//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']
This *is* supported in XPath 1.0.
[...]
Hope this helps a bit. -- Gruß/Regards, Thomas Schraitle