Forum Discussion
XPath and name space
- Jun 12, 2019
Hi,
I recommend using setProperty Method.
Public Sub Sample()
With CreateObject("MSXML2.DOMDocument")
.async = False
If .Load("C:\Test\Test.xml") Then
.SetProperty "SelectionNamespaces", "xmlns:n1='http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader'"
Debug.Print .SelectNodes("//n1:Identifier").Item(0).XML
End If
End With
End SubBest regards,
kinuasa
Hi,
I recommend using setProperty Method.
Public Sub Sample()
With CreateObject("MSXML2.DOMDocument")
.async = False
If .Load("C:\Test\Test.xml") Then
.SetProperty "SelectionNamespaces", "xmlns:n1='http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader'"
Debug.Print .SelectNodes("//n1:Identifier").Item(0).XML
End If
End With
End Sub
Best regards,
kinuasa