|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Problems passing attributes
To add to what David and Jarno have said:
self::*[@border] translates into English as "the context node (itself), if it has a 'border' attribute" and would be almost the same as .[@border], except that the latter is not allowed (as Jarno said). (I say almost the same since '.' is short not for "self::*" but for "self::node()". node() selects nodes of any type, whereas * selects only nodes of the primary type of the axis, usually elements.) *[@border] is short for "child::*[@border]" But "self::" and "child::" have nothing to do with namespaces; rather, they are XPath axis specifiers. Check out the XPath spec for full details. As Jarno and David said, XPath is built into XSLT and no special namespace apparatus is needed to use it. Don't get thrown off by the appearance of the colon. 'self::*' and 'self:*' are two very different things. 'self::*' is the element on the self axis, whereas 'self:*' would be short for 'child::self:*', meaning all elements in the 'self' namespace on the child axis. But please don't ever use a namespace prefix like 'self' or 'child' or 'ancestor' unless you want your code to be unintelligible even to yourself. This would truly be horrible: self::ancestor:node[@child:border] which would translate as "the context node itself, if and only if it is an element named 'ancestor:node' and has an attribute named 'child:border'". Yikes! Confused yet? :-) Cheers, Wendell
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|

Cart








