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

RE: Deleting a node depending on contents of a grandfa

Subject: RE: Deleting a node depending on contents of a grandfather attribute and a child node
From: "John Reid" <John.Reid@xxxxxxxxxxxxxxx>
Date: Thu, 31 Jul 2003 07:50:23 +1000
xsl delete
I understood that I could not use variables in a template match
statement such as
<xsl:template match="absent[ancestor::player/@pword=$varpword
    and from=$vardate]"/>
Or am I missing something?
Salud
John
John Reid wrote:
> i have tried a number of approaches but with various but not correct
> results. I want to delete the absent node (and everything below it)
> where $vardate = from and @pword $varpword.
...
>     <xsl:variable name="pword" select="ancestor::@pword"/>
Wont select anything, ever. Try
      <xsl:variable name="pword" select="ancestor::player[1]/@pword"/>
or if the player node is always the grandfather
      <xsl:variable name="pword" select="../../@pword"/>

>     <xsl:copy>
>       <xsl:apply-templates select="@*|node()[not($date1 = $vardate and
> $pword = $varpword)]"/>
>   </xsl:copy>

This does not quite match your problem description ("I want to
delete the absent node"). The following template
  <xsl:template match="absent[ancestor::player/@pword=$varpword
    and from=$vardate]"/>
will make processing the nodes in questions a no-op (iow kill it),
other absent nodes are copied through by the other template.

J.Pietschmann



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 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.