[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Attributes and Axis
Antonio,
At 11:58 AM 4/13/2006, you wrote: Hi all: Right. This won't work since attributes don't have siblings. They have parents, but since they aren't children of their parents, they aren't siblings of the other attributes. But ofcourse that wont work... This works because when attributes are selected they are assigned a context position, so there will be a last one -- but which one it is, is up to the processor, since attributes are not ordered in the data model. But what if i need to use axis with attributes? Or there arent't axis with attributes? If so, how can i refrence other attributes on the same element? This is one place where XSLT 1.0 gets dicey. You can say ../@* to get all the attributes on an element, starting from one of them. To get all the *other* attributes, however, you more or less have to use an explicit name test, as in "../@*[not(name()=name(current())]", which is admittedly fairly ugly. In XPath 2.0 you can say ../@*[not(. is current())] which is a bit better, if not much. To say more, we'd have to know more about why you're asking. In general, these limits reflect the "second-class" status of attributes in the XML/XSLT paradigm. Assuming your XML is well-designed, this is mostly a good thing (attributes are easily hidden or ignored, etc.): when something is "first-class" it should be an element. I do understand that much XSLT is written to ameliorate badly-designed XML. 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 ======================================================================
|
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
|