xpath - XQuery: Getting multiple attribute values -


so i'm trying access country codes of following, no luck:

  <river id="river-rhone" country="f ch">   <name>rhone</name>   <located country="f" />   <located country="ch"/>   </river> 

is there way them? tried access them index nothing works. appreciated!

it seems want /located/@country output:

xquery:

let $xml := <river id="river-rhone" country="f ch">               <name>rhone</name>               <located country="f" />               <located country="ch"/>              </river> $country in $xml//located/@country return   <p>{data($country)}</p> 

output:

<p>f</p> <p>ch</p> 

Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -