troubleshooting Question

Get xml data

Avatar of JJKing
JJKingFlag for United Kingdom of Great Britain and Northern Ireland asked on
Web Languages and StandardsVisual Basic ClassicXML
2 Comments1 Solution735 ViewsLast Modified:

I have the following xml document and I want to retrieve the <env:identity> value. I am using VB.Net and have code to try and extract the data but I cannot seem to get it to work.

Any Ideas ?

<Envelope xmlns="" xmlns:env="" xmlns:xsi="" xmlns:xsd="" xsi:schemaLocation=" Prototype_Order.xsd">
                  <env:reference uri="#BasdaOrder@1">
    <Order xmlns="urn:schemas-basda-org:2000:purchaseOrder:xdr:3.01" xmlns:xdr="XDR-compat-v1" xmlns:xsi="" xsi:schemaLocation="urn:schemas-basda-org:2000:purchaseOrder:xdr:3.01 Order-v3.xsd">
Public Function RetrieveXMLNodeData() As String
            RetrieveXMLNodeData = Nothing
            Dim doc As New XmlDocument
            Dim root As XmlElement = doc.DocumentElement
            Dim Nmspc = New XmlNamespaceManager(doc.NameTable)
            Nmspc.AddNamespace("A", "env:")
            RetrieveXMLNodeData = root.SelectSingleNode("A:properties/A:identity",  nmspc).InnerText
Catch ex As Exception
            Throw ex
        End Try
    End Function
Senior Solution Architect

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros