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
Post a Comment