-1

Lets say this is my default code:

<panel>
 <fontstyle>A</fontstyle>
 <fontsize>12</fontsize>
 <location>100,100</location>
</panel>

and when I add in another tag:

<programsetting>
    <panel>
        <fontstyle>A</fontstyle>
        <fontsize>12</fontsize>
        <location>100,100</location>
      </panel>
    <panel>
        <fontstyle>B</fontstyle>
        <fontsize>12</fontsize>
        <location>100,100</location>
      </panel>
 </programsetting>

So we have 2 same tag names within the group but how do i determine to get B rather than A since I have both the same group name and data name.

2 Answers2

0

Not sure what technique you are currently using but you could use an xpath query (xpath query).

depending on the selection criteria you could use

/programsetting/panel[last()]

to get the last element or

/programsetting/panel[fontstyle="B"]

to get the element with a certain fontstyle.

Patrick
  • 361
  • 2
  • 12
  • Using Visual Basic 2008. Basic my combobox there's is only 1 value and that's called 'Panel'. So once I select 'panel' then click on load to datagridview and it will post the data to DGV. So this is mine button code: ds.ReadXml(filepath) – Clement Jun 03 '13 at 09:51
  • erm what combobox? you need to provide more information on what you are trying to achieve and how you are doing it if you want some serious help – Patrick Jun 05 '13 at 09:34
0

How to Get XML Node from XDocument It is on c# but you can easily convert it.

Community
  • 1
  • 1
kostas ch.
  • 1,960
  • 1
  • 17
  • 30