OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Namespace Selection using SelectionNamespaces property

[ Lists Home | Date Index | Thread Index ]
  • To: "XML-DEV (E-mail)" <xml-dev@lists.xml.org>
  • Subject: Namespace Selection using SelectionNamespaces property
  • From: Jason Brown <Jason@i2.co.uk>
  • Date: Thu, 9 Jan 2003 12:51:44 -0000

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





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS