xml - can I use current() function in XPath, outside of XSLT? -



xml - can I use current() function in XPath, outside of XSLT? -

this xml document:

<root> <bad> <id>13</id> <id>27</id> </bad> <books> <book id='5'/> <book id='7'/> <book id='13'/> </books> </root>

now i'm trying select books not "bad":

/root/books/book[not(/root/bad/id[.=@current()/@id])]

this doesn't work. i'm getting books, while book no.13 should excluded. it's not xslt. it's xpath request (i'm java). what's wrong?

the current() function supported xslt. there's no need utilize current() here. can result want next expression:

/root/books/book[not(@id=/root/bad/id)]

xml xpath

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -