Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. xml in .net

xml in .net

Scheduled Pinned Locked Moved Visual Basic
csharpcomxmltutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    subbu sk
    wrote on last edited by
    #1

    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}&amp;password={1}&amp;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;amp;password={1}&amp;amp;track=1&lt;/URL&gt; <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.

    C 1 Reply Last reply
    0
    • S subbu sk

      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}&amp;password={1}&amp;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;amp;password={1}&amp;amp;track=1&lt;/URL&gt; <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.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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 )

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups