Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / February 2008

Tip: Looking for answers? Try searching our database.

xmlelement

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
deepak - 07 Feb 2008 18:25 GMT
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 appreciated in advance.

Thanks,
Deepak
kr_deepak123@hotmail.com
kr_deepak123@yahoo.co.in
Martin Honnen - 07 Feb 2008 18:32 GMT
> Hi All,
>
[quoted text clipped - 29 lines]
>
> so is there any loop required ,kindly tell me as how to get it?

VB.NET pseudo code
 Dim doc As New XmlDocument()
 doc.Load("file.xml")
 Dim name As String = "ER_Kista"
 Dim conversion As XmlNode =
doc.SelectSingleNode(String.Format("/SXPDictionaryItemsGetResult/DictionaryItems/TimeZoneConverter[Name
= '{0}']/Conversion", name))
 If Not conversion Is Nothing Then
   Console.WriteLine(conversion.InnerText)
 Else
   Console.WriteLine("Element not found")
 End If

Signature

    Martin Honnen --- MVP XML
    http://JavaScript.FAQTs.com/

deepak - 07 Feb 2008 18:48 GMT
wow martin you are great....its working...:-) thanks a lot
may i add u in my msn or yahoo
my id is kr_deepak123@yahoo.co.in
and hotmail is kr_deepak123@hotmail.com

kindly add me, i want to be with those perosns which are experts in coding
.net like you...u helped me very much .. i can not forget this help...u dont
know how much u helped thanks again

> > Hi All,
> >
[quoted text clipped - 42 lines]
>     Console.WriteLine("Element not found")
>   End If

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.