Let's say I have some XML that looks like this:
<Users>
<User>Bob</User>
<User>Stefania</User>
</Users>
If I wanted to select line 3, one of the ways I could do it like this using local-name():
//*[local-name()='Users']/*[local-name()='User'][1]
My question is this. Is it possible to select multiple nodes using one statement? I've tried:
//*[local-name()='Users/User'][1]
In reality, the strings would be replaced with variables. In XForms a real example would look like this:
<xf:var name="users" value="'Users"/>
<xf:var name="user" value="'User"/>
<xf:setvalue ref="//*[local-name()=$users/$user][1]" value="'Jim'"/>
But that doesn't work.
What I'd like to be able to do it something like this:
<xf:var name="users" value="'Users"/>
<xf:var name="user" value="'User"/>
<xf:var name="myPath" value="'$users/$user'"/>
<xf:setvalue ref="//*[local-name()=$myPath][1]" value="'Jim'"/>