[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: "Robert P. J. Day" <rpjday@xxxxxxxxxxxxxx>
Date: Mon, 17 Mar 2003 15:54:32 -0500 (EST)
selecting nodes within a namespace
On Mon, 17 Mar 2003, Jeni Tennison wrote:

> Hi Robert,
> 
> > if i want to select all nodes in a given namespace ("auth"), it
> > appears i can use:
> >
> >   //namespace::auth
> 
> 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?
 
> 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 -- as i said before, tidwell's example
has, embedded in the XML, the excerpt:

  <auth:author xmlns:auth="...">
   <last-name>...
   ...
  </auth:author>

a couple pages later, he implies that the XPath expression
"/sonnet/auth::*" should return the <auth:author> element.  instead,
xpathtester simply gives me the above ERROR.

is this just an xpathtester thing?  time to switch utilities, methinks.

rday



 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.