Re: attribute test
On 9/15/05, Spencer Tickner <spencertickner@xxxxxxxxx> wrote: > hi guys, > > First, Thanks for the suggestions, Unfortunately both return all 3 > test cases first mentioned. I will continue to try to work this out, > Once again if you have any more suggestions they are very appreciated. > Ah, that's because I must confess to not paying that close of attention to your original post. :P You actually have two conditions: first, any document that contains one foo that does not have the @att should print if all foo have @att then they should not have 'hi' A quick path of the top of my head (and I did test it) shows <xsl:template match="/"> <xsl:if test="/Root/foo[not(@att)] or /Root/foo/@att!='hi'"> <xsl:apply-templates /> </xsl:if> </xsl:template> works. Jon Gorman > Thanks, > > Spencer > > On 9/15/05, Jon Gorman <jonathan.gorman@xxxxxxxxx> wrote: > > Ack, been hit by the stolen words gnomes" > > > > This > > > (not() is negation. When working with node sets and equality (=,!=) I believe > > > XPath returns true if there is any node in the node set that satisifies the > > > condition. > > > > > > > I was kinda wondering how that solution was working but figured > > > perhaps my brain was scrambled today as well ;). > > > > Well, apparently it is at least partially scrambled. > > > > Jon Gorman
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