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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Namespace Selection using SelectionNamespaces property

[ Lists Home | Date Index | Thread Index ]

Hi Jason,

> 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

As I explained, in XPath an element name without a prefix is *always*
interpreted as refering to an element that belongs to no namespace.
You can't declare a default namespace for the interpretation of
element names in XPath 1.0.

However, this *is* something that is included in XPath 2.0. So give it
another year or so (for XPath 2.0 to reach Recommendation and be
implemented by Microsoft) and you'll be able to do what you want to
do. In the meantime, declare a single-letter prefix and use that
everywhere -- it's only two characters on each element name and it
does make it clearer what kinds of elements your referring to.

Or of course you could stop using namespaces in your XML document, but
I wouldn't really recommend that.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/





 

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

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