[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 13:05:38 -0000
Title: Namespace Selection using SelectionNamespaces property
From: Jason Brown
Sent: 09 January 2003 13:05
To: 'Jeni Tennison'
Subject: RE: Namespace Selection using SelectionNamespaces
and apologies for me not picking that up from your first mail. ** I am not worthy!! **
From: Jeni Tennison [mailto:jeni@j...]
Sent: 09 January 2003 13:04
To: Jason Brown
Cc: XML-DEV (E-mail)
Subject: Re: Namespace Selection using SelectionNamespaces
> 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.
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