[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Copying and updating selectively
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 >= $varFrom and $id <= $varTo)]|@*"/> To this: <xsl:apply-templates select="node()[not(self::text())]|text()[not($id >= $varFrom and $id <= $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
|
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
|