You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Benoit Fouche <b....@cross-systems.com> on 2000/03/31 12:45:04 UTC

Tr: How to access xml tag attribute with XSL ?

> 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