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

Re: testing an attribute value and node value

Subject: Re: testing an attribute value and node value
From: "Russ Holmes" <rholmes@xxxxxxxxx>
Date: Wed, 20 Sep 2000 10:14:10 +1200
xsl when test attribute
What syntax would I need to get it to work with MSXML3?

I've tried;

   <xsl:when test="@n[.='100'] and [.='1']"><B>100 Works</B></xsl:when>
..
   <xsl:when test="[@n[.='100'] and .='1']"><B>100 Works</B></xsl:when>
..
   <xsl:when test="@n[.='100' and .='1']"><B>100 Works</B></xsl:when>
..
   <xsl:when test="@n[.='100'] and [.='1']]"><B>100 Works</B></xsl:when>
..


----- Original Message -----
From: "Kay Michael" <Michael.Kay@xxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxx>
Sent: Tuesday, September 19, 2000 8:43 PM
Subject: RE: testing an attribute value and node value


> > My XML is;
> >
> > <?xml version='1.0'?>
> > <PageData>
> >        <CUSTOM>
> >             <F n="100">1</F>
> >             <F n="101">1</F>
> >        </CUSTOM>
> > </PageData>
> >
>
> > So, if current node n="100" and the current node value = '1'
> > then output
> >
> >     <B>100 Works</B>
> >
> > if current node n="101" and the current node value = '1' then output
> >
> >     <B>101 Works</B>
> >
> > My XSL looks like;
> >
> > <xsl:template match="F">
> > <DIV>
> >   <xsl:choose>
> >       <xsl:when test="@n[.='100' and //F[.='1']]"><B>100
> > Works</B></xsl:when>
> >       <xsl:when test="@n[.='101' and  //F[.='1']]"><B>101
> > Works</B></xsl:when>
> >   </xsl:choose>
> >  </DIV>
> >
> > </xsl:template>
> >
> Oh dear, you are very confused. Your condition is testing "if the current
> node has an @n attribute whose value is '100', and if the document
contains
> an F element whose string-value is '1'.
>
> Try <xsl:when test="@n='100' and .='1'">
>
> Mike Kay
>
>
>  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

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.