xmlelement

D

deepak

Hi All,

SXPDictionaryItemsGetResult is a XML element given below



<SXPDictionaryItemsGetResult>
<DictionaryItems>
<TimeZoneConverter>
<Key>127928320</Key>
<Revision>2</Revision>
<Name>India_Bharti</Name>
<Conversion>0</Conversion>
</TimeZoneConverter>
<TimeZoneConverter>
<Key>127928321</Key>
<Revision>1</Revision>
<Name>Spain_Amena</Name>
<Conversion>0</Conversion>
</TimeZoneConverter>
<TimeZoneConverter>
<Key>127928325</Key>
<Revision>2</Revision>
<Name>ER_Kista</Name>
<Conversion>1</Conversion>
</TimeZoneConverter>
</DictionaryItems>
</SXPDictionaryItemsGetResult>


I want to retreive using VB.NET(actually i m using VB.NET in a ASP.NET Page)

that value present inside the conversion which belongs to ER_Kista.
e.g. 1 here (for India_Bharti)


so is there any loop required ,kindly tell me as how to get it?
The general solution should be like a parameter passed (which wil be value
of Name)
and get that corresponding value inside conversion tag.







Any help is apprecited in advance
thanks,
Deepak
(e-mail address removed)
(e-mail address removed)
 
B

bruce barker

sorry, don't know vb. assuming you loaded the xml into an XmlDocument:

string name = "ER_Kista";
string converstion = "";
string path =
"//SXPDictionaryItemsGetResult/DictionaryItems/TimeZoneConverter[Name='{0}']/Conversion";

XmlNode node = xmldoc.SelectSingleNode(string.Format(path,name);
if (node != null)
conversion = node.Value;

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top