We help IT Professionals succeed at work.

Parse xml into name value pairs...  Maybe using XMLPath?

Rog D
Rog D asked
Last Modified: 2008-08-12
I have a short xml string that I want to easily parse into name / values, but am not sure of the best easiest way to do this...

Here is the string...

<Properties><Property name="Status" value="dasfasdf" /><Property name="Permit#" value="asdfas" /><Property name="License Plate Number" value="asdfasdf" /><Property name="Recipient(ADISID)" value="asdfasfd" /></Properties>

I need to convert this to an html string like the following  Can be table or string with vbcrlf if needed.
Using XMLPath?

Name  Value
Name  Value
Name  Value

How can this be easily Accomplished.  Below is a sample I was working with....
Function ParseCustomProperties(ByVal rawdata As String) As String
        Dim xmlDoc As New XmlDocument
        Dim propertyNodes As XmlNodeList
        Dim propertyNode As XmlNode
        Dim baseDataNodes As XmlNodeList
        Dim bFirstInRow As Boolean
        Dim sOut As String = String.Empty
        Dim sTemp As String = String.Empty
        Dim sName As String = String.Empty
        Dim sValue As String = String.Empty
        propertyNodes = xmlDoc.GetElementsByTagName("Property")
        For Each propertyNode In propertyNodes
        Return sOut
    End Function

Open in new window

Watch Question

Most Valuable Expert 2012
Top Expert 2008
This one is on us!
(Get your first solution completely free - no credit card required)
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.