[XML-DEV Mailing List Archive Home]
[Reply To This Message]
Namespace Selection using SelectionNamespaces property
- To: "XML-DEV (E-mail)" <xml-dev@l...>
- Subject: Namespace Selection using SelectionNamespaces property
- From: Jason Brown <Jason@i...>
- Date: Thu, 9 Jan 2003 12:51:44 -0000
Title: Namespace Selection using SelectionNamespaces property
I am using the following code to select a node from a document.
'XPath as the search language
xmlDOM.setProperty "SelectionLanguage", "XPath"
'Select a namespace
xmlDOM.setProperty "SelectionNamespaces", "xmlns:i2='http://www.i2group.com'"
'Search for specified node
Set elmTest = xmlDOM.selectSingleNode(txtNode.Text)
'Catch 'some' errors
If Not elmTest Is Nothing Then
txtOutput = txtOutput.Text & vbCrLf & vbCrLf & "node searched for = " & txtNode.Text & vbCrLf & elmTest.xml
MsgBox "invalid XPath Statement"
The code works fine as long as I specify the namespace at every level
What I would like to do is set i2 as a default namespace so I can minimise the amount of typing for retrieval.
I have tried not specifying a prefix in the SelectionNamespaces property, however this does not work, I just get an XPath error
Any Ideas welcome
The Visual Space
Tel: (01223) 728 670
Fax: (01223) 728 601
Mobile: 07952 246 375
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
Stylus Studio has published XML-DEV in RSS and ATOM formats,
enabling users to easily subcribe to the list from their preferred news reader application.
Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website.
they were not included by the author in the initial post. To view the content without the Sponsor Links please