xml in .net
-
Hai all, i am totally new for xml files in .net. i have one xml file like <Gateway> <Name>ONE</Name> <UserID>inone</UserID> <PWD>one</PWD> <URL>http://ap.abc.com/http/sen.asp?user={0}&password={1}&track=1</URL> <Weight>100</Weight> </Gateway> <Gateway> <Name>Two</Name> <UserID>intwo</UserID> <PWD>two</PWD> <URL>http://ap.abc.com/http/sen.asp?user={0}&amp;password={1}&amp;track=1</URL> <Weight>90</Weight> </Gateway> now i had to get the url by using the category(Name ONE,TWO)in xml file..... in a function public function geturl(by val category as string)string dim strurl as string="" *********** I need some guidance to...how to get the url which is in xml in vb.net? return strurl End function
Thanks Subbu.
-
Hai all, i am totally new for xml files in .net. i have one xml file like <Gateway> <Name>ONE</Name> <UserID>inone</UserID> <PWD>one</PWD> <URL>http://ap.abc.com/http/sen.asp?user={0}&password={1}&track=1</URL> <Weight>100</Weight> </Gateway> <Gateway> <Name>Two</Name> <UserID>intwo</UserID> <PWD>two</PWD> <URL>http://ap.abc.com/http/sen.asp?user={0}&amp;password={1}&amp;track=1</URL> <Weight>90</Weight> </Gateway> now i had to get the url by using the category(Name ONE,TWO)in xml file..... in a function public function geturl(by val category as string)string dim strurl as string="" *********** I need some guidance to...how to get the url which is in xml in vb.net? return strurl End function
Thanks Subbu.
Load the XML into the XmlDocument class. This impliments the standard W3C DOM for accessing XML. Then you can do something like doc.SelectNodes("/Gateway/URL") to get a collection of the URL nodes, which you can then iterate over and examine. The language used to selecte nodes is called XPath.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )