HLRosenberger
asked on
Parse a URL key value
I need to parse this:
"<key><cv><c>ID</c><v>245< /v></cv></ key>"
I used QueryString("parm_name") to obtain this value. I need the 245. Now , I could just use Split or some other general parse mechanism, but is that a specific URL parse mechanism to do this?
"<key><cv><c>ID</c><v>245<
I used QueryString("parm_name") to obtain this value. I need the 245. Now , I could just use Split or some other general parse mechanism, but is that a specific URL parse mechanism to do this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Or you can parse the XML using system.xml - you can also easily access the rest of the string:
Imports System.XML
Public Sub test()
Dim strData As String = "<key><cv><c>ID</c><v>245</v></cv></key>"
Dim xmlDoc As New XmlDocument
xmlDoc.LoadXml(strData)
Dim xmlNode As XmlNodeList = xmlDoc.GetElementsByTagName("v")
MessageBox.Show(xmlNode(0).InnerXml)
End Sub
ASKER
thanks
ASKER