xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Carroll <...@micromuse.com>
Subject Re: How to access xml tag attribute with XSL ?
Date Fri, 31 Mar 2000 10:19:40 GMT
Benoit Fouche wrote:

> Hi,
> I'm novice with XSL, and I'd like to know if it's posible to access to an
> XML tag attribute using an XSL stylesheet associated with the XML doc ?
>
> example:
>     xml doc:
>     <card id='menuCard' title='menu1'>
>         <p align='left'>
>             Hello guys !
>         </p>
>     </card>
>
>     So, I would like to access to the "id" and "title" attributes of the tag
> <card>...
>
> I've writing this for the XSL stylesheet:
> <?xml version="1.0" encoding="ISO8859-1"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
>
> <xsl:template match="/">
>   <HTML>
>   <BODY>
>     <xsl:for-each select="wml/card">
>     ...here i want to write the title of card...

>
>     <p align="center">
>           <xsl:apply-templates/>
>      </p>
>     </xsl:for-each>
>   </BODY>
>   </HTML>
> </xsl:template>
>
> </xsl:stylesheet>
>
> Thank for helping me !
> Ben.
> bfouche@caramail.com
>
> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org

HI,

use


> <?xml version="1.0" encoding="ISO8859-1"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
>
> <xsl:template match="/">
>   <HTML>
>   <BODY>
>     <xsl:for-each select="wml/card">
>     ...here i want to write the title of card...

<xsl:value-of select="@title"/>

>
>     <p align="center">
>           <xsl:apply-templates/>
>      </p>
>     </xsl:for-each>
>   </BODY>
>   </HTML>
> </xsl:template>

cheers,

John.


Mime
View raw message