I need to match elements that contain neither PCDATA nor children elements.
I tried this :
.//myelem[count(nodes())=0]
but nodes() is unknown in XPATH 1.0.
What is the most concise way that you know of to do this in XPATH 1.0 ?
I need to match elements that contain neither PCDATA nor children elements.
I tried this :
.//myelem[count(nodes())=0]
but nodes() is unknown in XPATH 1.0.
What is the most concise way that you know of to do this in XPATH 1.0 ?
You were close - it is node()
, not nodes()
:
.//myelem[count(node()) = 0]
or, more idiomatically:
.//myelem[not(node())]