[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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. ________________________________________________________________________
|
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
|