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

RE: select="*/@UNITS/.."

Subject: RE: select="*/@UNITS/.."
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Thu, 18 Mar 1999 10:53:33 -0000
RE: select="*/@UNITS/.."
Title: RE: select="*/@UNITS/.."

> I'm trying to find all child elements that have UNITS attributes by
> using * to find all child elements, @UNITS to winnow those down to the
> ones with UNITS attributes, and .. to select the parent node,
> like this:
>
> <xsl:template match="ATOM">
>   <xsl:apply-templates select="*/@UNITS/.."/>
> </xsl:template>
>
> However, this doesn't seem to actually work. Does anyone see a problem
> with what I'm doing?

Well one point is that the spec doesn't say whether an element is considered to be the parent of its attributes; it does however say that the children of an element are its child elements and character content (i.e. not its attributes), and we can guess that "parent" is intended to be the inverse relationship of "child".

But there's a much easier and cleaner way of doing it anyway:

> <xsl:template match="ATOM">
>   <xsl:apply-templates select="*[@UNITS]"/>
> </xsl:template>

Mike Kay

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.