[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: The identity transform and attributes
Andrew Welch wrote:
On 21/01/2008, David Carlisle <davidc@xxxxxxxxx> wrote: My intuition is the same as yours ;) I understand the reasoning behind the decisions, but I find myself doing a lot of extra work when I am dealing with attributes. I always have to remind myself whether it is an attribute node or an element node. Funnily enough, I don't have that same problem with text nodes or document nodes, somehow I find them (though different) more "intuitive". Attributes are leaf nodes and work the same way as namespace nodes, and or the following (not tested), which has the advantage of not using unschema-aware strings: <xsl:template match="@*[not(../@foo is .)] but that's hardly clearer Again, I don't know why the self axis isn't available for attribute nodes... any ideas? Not 100% certain here, but I vaguely remember that self:: only works on elements and document nodes, not on other node types (i.e., a text node does not have a self:: axis, nor does a PI or a comment) . And an attribute's self:: axis would naturally be an attribute axis, which cannot hold. Cheers, -- Abel --
|
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
|