I have a loop like this:
for $a in local:distinct-nodes($x/input/book[@stat = 'ok'])
let $b:=string($a/../input/@docid)
This returns an empty string($b is empty). So, I am wondering how I can access the parent node in this situation. I do not really want to access it from root (//xxxx) cause the XML file is quite large.
Yes, this is what should be produced.
All $a nodes are
bookelements.are
inputelementsshould be
input/inputelements, but most probablyinputelements dont haveinputchildren.What you want is: