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

Re: Accessing current node attributes

Subject: Re: Accessing current node attributes
From: James Clark <jjc@xxxxxxxxxx>
Date: Wed, 16 Sep 1998 11:44:11 +0700
xsl current node attribute
In the next draft I would expect (my personal opinion not an official WG
statement) it to be possible to qualify ".", so you could say

 <xsl:if test='.[attribute(href)="http://www.ibm.com/"]'>

The syntax you suggest

 <xsl:if test='attribute(href)="http://www.ibm.com/"'>

and I can see ways we might be able to make that work as well.

George Phillips wrote:
> 
> Bart Schuller wrote:
> > On Mon, Sep 14, 1998 at 11:32:20AM -0700, George Phillips wrote:
> > >   <xsl:template match="a[attribute(href)]">
> > >     <A HREF="{.[attribute(href)]}">
> > >     <xsl:value-of expr="." />
> > >     </A>
> > >   </xsl:template>
> > >
> > > But "{.[attribute(href)]}" doesn't get me the HREF attribute of the
> > > current A node being processed.  Not that I expect it to as it is
> >
> > Use <A HREF="{attribute(href)}">
> 
> Thanks.  Sorry to ask such a dumb question.  Nevertheless, here's
> another:  can I use <xml:if> to check for particular attribute values?
> For example, one might write:
> 
>         <xsl:template match="a">
>        <xsl:if test='attribute(href)="http://www.ibm.com/"'>
>              <a-link-to-the-ibm-home-page/>
>           </xsl:if>
>         </xsl:template>
> 
> The XSL grammar and xt both agree that the example does not fly.
> Can an "if" test like that be written?  I know you can use;
> 
>         <xsl:template match="a[attribute(href)='http://www.ibm.com/']">
> 
> but that doesn't pan out well if you are testing many different
> attributes in different combinations.
> 
>                         -- George
> 
>  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.