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

Re: Problems passing attributes

Subject: Re: Problems passing attributes
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Mon, 01 Oct 2001 14:45:50 -0400
problem with attribute in axis
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


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================


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.