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

RE: $5 PAYPAL for correct answer still not claimed! Se

Subject: RE: $5 PAYPAL for correct answer still not claimed! Searching for an attribute across different elements with ancestoral elements returned
From: Bedwell Tom <Tom.Bedwell@xxxxxxx>
Date: Fri, 20 Jul 2001 12:14:47 +0100
RE:  $5 PAYPAL for correct answer still not claimed! Se
I wish to return all brands/lines/items that have this @OFFER attribute.
If it is an ITEM I wish to return its parent LINE and grandparent BRAND as
well.  If it is a LINE, I wish to return its child ITEMs and parent BRAND as
well.  If it is BRAND I wish it to return its child LINEs and its
grandchildren ITEMs. I DO NOT WANT any siblings of the matched element.


______________________________

Transform the problem so you look at the attributes of decendants and you
get a solution like this.


<!-- This copies any element having a descendant with an  OFFER attribute
-->

<xsl:template match="*[descendant::*[@OFFER]]">
<xsl:copy>
	<xsl:copy-of select="@*"/>
	<xsl:apply-templates select="*"/>
</xsl:copy>
</xsl:template>

<!-- this duplicates an offer element and all its descendants-->
<xsl:template match="*[@OFFER]">
	<xsl:copy-of select="."/>
</xsl:template>


Tom

 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.