.net - XML Xpath Query -


i have been converting vb.net xml code read specific xml elements opposed attribute values, , have following line has stumped me:

dim fnode xmlnodelist = x.selectnodes(string.format("tables                                                           /table                                                             /field[                                                               @pkid='{0}'                                                             ]", fk)) 

my questions regarding end part, how write check elements value opposed specific attribute? specific element want check <pk> , want evaluate against fk.

thanks.

tables/table/field[pk='{0}'] 

there nothing special attributes in context - can test against value of pk element removing @.

example input xml:

<tables>     <table>         <field>             <pk>42</pk>             <!-- other fields -->         </field>     </table> </tables> 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -