My xml is:
<record>
<field name="f1"/>
<id name="f2"/>
<id name="f3"/>
<field name="f4"/>
<info/>
</record>
I want to loop through it in xquery like this:
for $i in $records/record/field | $records/record/id
return
if ( .... $i is id .... ) then .... do something .... else ... do something else ...
Is this possible? How can distinguish when $i
is id and when it is field?