[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: how to select elements in a given namespace?

Subject: Re: how to select elements in a given namespace?
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Mon, 17 Mar 2003 21:02:33 +0000
xsl select a given node
Hi Robert,

>> That will select all the *namespace*nodes* named "auth". Namespace
>> nodes are nodes that represent a prefix-namespace binding. Such a
>> namespace node will exist on every element within the scope of the
>> xmlns:auth="..." namespace declaration.
>
> ah, right, so there will be a "child" namespace node for each
> element within the scope of the declaration. this would represent
> the parent <auth:author xmlns:auth=...> element itself and its five
> children, correct?

That's right.

>> If you want to select all the elements in the namespace associated
>> with the prefix 'auth', use:
>> 
>>   //auth:*
>> 
>> All attributes in that namespace with:
>> 
>>   //@auth:*
>> 
>> Note that the 'auth' namespace must be declared in the stylesheet
>> (or in whatever context you're selecting the nodes). A stylesheet will
>> not automatically pick up on the fact that the namespace is declared
>> in the XML document.
>
> in fact, those were two of the first things i tried. both of the
> above generate "ERROR: Prefix auth has not been declared". and since
> i'm using xpathtester, it can't be a stylesheet issue. so i'm still
> a bit confused

It sounds to me as if you haven't declared the 'auth' prefix within
xpathtester. I don't know the tool, but there should be a way for you
to set up the namespaces and associated prefixes that you want to use
in your XPath so that you can then use those prefixes in the paths
that you want to test.

Cheers,

Jeni

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


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

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