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

Re: The identity transform and attributes

Subject: Re: The identity transform and attributes
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 21 Jan 2008 12:35:23 GMT
Re:  The identity transform and attributes
> I've been caught out before doing things like:
I think that's a different problem though, unrelated to the fact that
attributes don't take children.


> ...which doesn't work - you have to use name()
at least you don't have to use name in xslt2 (although you still can't
use self::)
"@* except @foo"
for example works and probably is more readable than the self:: test anyway.

> Again, I don't know why the self axis isn't available for attribute
> nodes... any ideas?

The confusing thing is that attribute nodes are on the self axis, if you
are on an attribute then self::attribute() selects the current node,
it's "just" that the QName node test always goes via the "principle node
type" kludge/feature and they decided to keep that being fixed for each
axis to a single node type, element in the case of self::. personally I
think it would have been much simpler if axis::foo had selected any node
with name foo that is in the axis axis:: It's hard to make any examples
where that formulation would have been different in practice from what
was specified, except for making self::foo select an attribute named foo
if it is the current node, which would have been an improvement.
in xpath2 of course you can go self::attribute(foo) but I can't see what
harm would have resulted from allowing (in xslt 1) self::foo for this.
In XPath 2 I think, given that attribute(foo) and the execpt operator
make the use for this a lot more rare anyway, they were right to keep
things compatible (but strange)


David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

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.