Subject: RE: [xsl] Selecting all the children accept those with particular attribute values From: "Clapham, Paul" <pclapham@xxxxxxxxxxxxx> Date: Thu, 1 Feb 2001 22:40:30 -0800 |
If you want all "except those with @att equal to value1 or value2", you need to code something equivalent to "@att != 'value1' and @att != 'value2'". Note the AND here, not an OR. Think about it for a minute... suppose @att is value1. Then it's not equal to value2 and your OR returns true. But if it's value2, then it's not equal to value1 and your OR returns true. And if it's something else, then it's not equal to either and your OR returns true. This is an old pitfall that has snared generations of computer programmers. PC2 -----Original Message----- From: Jo Bourne [mailto:venus@xxxxxxxxx] Sent: February 1, 2001 19:41 To: xsl list Cc: Jesse Reynolds Subject: [xsl] Selecting all the children accept those with particular attribute values Hi, In one of the templates in my stylesheet I need to match all the children of the current node except those with @att equal to value1 or value2. I have tried this so many different ways and I just can't seem to get it right.... Can I even do this in a single select or do I need to call a pre-prepared set? My current failed attempt looks like this: <xsl:template match="parent"> [......] <xsl:for-each select="child::*/[@att != 'value1' | @fy != 'value2']"> [......] </xsl:template> I started off more like this: <xsl:template match="parent"> [......] <xsl:for-each select="child::*[@att!=('value1'|'value2')]"> [......] </xsl:template> Thanks heaps Jo -- Jo Bourne Virtual Artists Pty Ltd 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] matching <br/> v. <br></b, Robert Koberg | Thread | "Deep-Equal Nodes" (Was: RE: [xsl] , Dimitre Novatchev |
Re: [xsl] matching <br/> v. <br></b, Mike Brown | Date | Re: [xsl] Finding another element w, Jeni Tennison |
Month |