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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top