Subject: RE: [xsl] Multiple level filtering with XSLT From: "Jeff Cann" <Jeff.Cann@xxxxxxxxxxxxxxx> Date: Sat, 24 Jul 2004 10:44:29 +0100 |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Please read the disclaimer at the bottom of this e-mail. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Thanks David. This worked a treat! Much appreciated. Regards, Jeff. -----Original Message----- From: David Carlisle [mailto:davidc@xxxxxxxxx] Sent: 22 July 2004 16:42 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] Multiple level filtering with XSLT change <xsl:when test="local-name()='c'"> <xsl:if test="not(@x=1)"> to <xsl:when test="local-name()='c'"> <xsl:if test="not(@x=1) and (not (d) or d[@x<7])"> however why match on * and then have a big xsl:choose switch, especially one using local-name() It's almost always better to use <xsl:when test="self::c"> rather than <xsl:when test="local-name()='c'"> and in this case you could just use template matching which would make it much easier to swap new filters in or out: <xsl:template match="*"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:apply-templates/> </xsl:copy> </xsl:template> <!-- empty templates for filters --> <xsl:template match="c[@x=1 or not(*[not(self::d[@x>=7)] ])]"/> <xsl:template match="d[@x>=7]"/> David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________ ********************************************************************** This email is intended for the named recipient(s) only. Its contents are confidential and may only be retained by the named recipient(s) and may only be copied or disclosed with the consent of LCH.Clearnet Limited. If you are not an intended recipient please delete this e-mail and notify postmaster@xxxxxxxxxxxxxxxx The contents of this email are subject to contract in all cases, and LCH.Clearnet Limited makes no contractual commitment save where confirmed by hard copy. LCH.Clearnet Limited accepts no liability, including liability for negligence, in respect of any statement in this email. LCH.Clearnet Limited, Registered Office: Aldgate House, 33 Aldgate High Street, London EC3N 1EA. Recognised as a Clearing House under the Financial Services & Markets Act 2000. Reg in England No.25932 Telephone: +44 20 7426 7000 Internet: http://www.lchclearnet.com **********************************************************************
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Multiple level filtering , David Carlisle | Thread | [xsl] Scripting in XSL, Ajit Sawant |
RE: [xsl] copy-of "canonicalizatio, Ganesh Babu Nallamot | Date | [xsl] XSLT2 Character Maps, Christian Roth |
Month |