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

Re: I mean self::* doesn't select attributes :(

Subject: Re: I mean self::* doesn't select attributes :(
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Wed, 25 Apr 2001 10:45:21 +0100
self attributes
Hi Evan,

> What I naturally tried was:
>
> @*[self::xyz:foo]
>
> But that doesn't work, because the self axis will *never* select
> attributes except with self::node(), being that *element* is the
> principal node type of the self axis and there is no attribute()
> node test (not that that would be useful).

An attribute() node test would be useful in this context if it
operated in the same way as processing-instruction() i.e. if you could
pass a string as a value to it and that would be used to test the name
of the attribute:

  @*[self::attribute('xyz:foo')]

Of course the string could be a variable:

  @*[self::attribute($attr)]

and then you could do things like:

  @attribute($attr)

rather than:

  @*[name() = $attr]

The big trouble would be handling namespaces with this syntax - is the
prefix in the name string resolved according to the current namespace
declarations within the stylesheet or is it a match between the
actual qualified name of the attribute in the source and the string
that you have?

Of course if you had that kind of node test for attributes, then you
may as well have one for elements as well.  I believe that this kind
of node test syntax was in an early WD of the XPath Rec.

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.