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

RE: Copying and updating selectively

Subject: RE: Copying and updating selectively
From: Américo Albuquerque <melinor@xxxxxxx>
Date: Mon, 28 Jul 2003 15:40:48 +0100
xsl parameter updating
Hi

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of John Reid
> Sent: Saturday, July 26, 2003 10:32 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE:  Copying and updating selectively
> 
> 
> Thanx Américo Albuquerque,
> 
> That worked well, and taught me something.
> 
> Another q
> 
> If I was to add another condition that is higher up the tree 
> how/where would I best test it Ie The same template but this 
> time I am asking only to test those players where pword a 
> parameter = @pword. This is really 2 problems for me, I guess 
> I would like to know the best way to pass a parameter to a 
> template as a condition of entry and to also know how to test 
> further up the tree.

You can add any condition as you like. To check for player/@pword just
change this line:
<xsl:apply-templates select="node()[not(self::text())]|text()[not($id &gt;=
$varFrom and $id &lt;= $varTo)]|@*"/>

To this:
<xsl:apply-templates select="node()[not(self::text())]|text()[not($id &gt;=
$varFrom and $id &lt;= $varTo and ancestor::player/@pword =
$varPword)]|@*"/>

The text()[not(condition)] will copy any text() node when not(condition) is
true, so you'll have to set condition=(you conditions to copy text)
In this case these conditions are:

$id greater or iqual to $varFrom
AND
$id smaller or iqual to $varTo
AND
Ancestor::player/@pword iqual to $varPword

We can add any others and wrap them all with a not(...) because you want to
delete those that match

Hope this helps you.

Regards,
Américo Albuquerque

(...)



 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.