xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: Accessing current node attributes


Subject: Re: Accessing current node attributes
From: George Phillips <phillips@xxxxxxxxxxxx>
Date: Tue, 15 Sep 1998 15:04:57 -0700

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



Current Thread
Keywords
xsl
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor