[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [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

selectionnamespaces
Title: Namespace Selection using SelectionNamespaces property

Hi Everyone,

I am using the following code to select a node from a document.

<Snippet>
    '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
    Else
        MsgBox "invalid XPath Statement"
    End If
</Snippet>

The code works fine as long as I specify the namespace at every level

        eg i2:Environment/i2:Defaults

What I would like to do is set i2 as a default namespace so I can minimise the amount of typing for retrieval.

        eg Environment/Defaults

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

Thanks again

Jason


Jason Brown
I2 Limited
The Visual Space
Capital Park
Fubourn
Cambridge
CB1 5XH

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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

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 click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.