.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

jQuery clickable div with working mailto link inside -

java - Getting corefrences with Standard corenlp package -

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -