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

Re: Understanding Identity Transformations

Subject: Re: Understanding Identity Transformations
From: Karl Stubsjoen <kstubs@xxxxxxxxx>
Date: Mon, 14 Feb 2005 13:06:40 -0700
transformations cats
Ya, but than you lose the top level element and in essence you end up
with no match at all.  (I think)


On Mon, 14 Feb 2005 13:53:34 -0600, JBryant@xxxxxxxxx <JBryant@xxxxxxxxx> wrote:
> If I understand correctly, you want all nodes that have a cat attribute
> but not when the cat attribute has a value of BLUE?
> 
> In that case:
> 
> <xsl:template match="*[@cat][not(@cat='BLUE')]"/>
> 
> or
> 
> <xsl:template match="*[@cat and not(@cat='BLUE')]"/>
> 
> Jay Bryant
> Bryant Communication Services
> (presently consulting at Synergistic Solution Technologies)
> 
> 
> Karl Stubsjoen <kstubs@xxxxxxxxx>
> 02/14/2005 01:35 PM
> Please respond to
> xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> 
> To
> xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> cc
> 
> Subject
> Re:  Understanding Identity Transformations
> 
> 
> [FOLLOW UP]
> 
> I get it!
> 
> This:
> <xsl:template match="*[@cat!='BLUE']" />
> 
> Will match all nodes where the cat attribute is not equal to 'BLUE'
> and... all nodes which do not have a cat attribute!!!
> 
> Really what I want is:
> <xsl:template match="FOO[not(@cat='BLUE')]" />
> 
> Which will match all nodes where the cat attribute is not equal to
> 'BLUE' and... here is the important pars... and match only FOO element
> who have a cat attribute!
> 
> Errr.... but couldn't get the first example to work until I
> distinguished that the element FOO is the one I was interested in
> matching.  Hmmmm.... I will feel triumphant when I can rewrite this
> with *[not(...)] rather than FOO[not(...)].  I guess the problem is
> that the top level node was not being matched.  So how to avoid
> colliding with the top level node in this case where there is no cat
> attribute?
> 
> Karl
> 
> On Mon, 14 Feb 2005 12:14:01 -0700, Karl Stubsjoen <kstubs@xxxxxxxxx>
> wrote:
> > Ok.. .the following is working great, but I am using != operand.  How
> > do you write the below match using not() and achieve same results?
> >
> > <xsl:template match="@* | node()">
> >  <xsl:copy>
> >        <xsl:apply-templates select="@*"/>
> >        <xsl:apply-templates />
> >  </xsl:copy>
> > </xsl:template>
> >
> > <xsl:template match="*[@cat!='BLUE']" />

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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