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

Re: attribute test

Subject: Re: attribute test
From: Jon Gorman <jonathan.gorman@xxxxxxxxx>
Date: Thu, 15 Sep 2005 16:30:15 -0500
jonathan gorman
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.

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 />


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
> > > XPath  returns true if there is any node in the node set that satisifies
> > > 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

Current Thread


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.
First Name
Last Name
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.