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

Re: add an attribute to an element, then use it in an

Subject: Re: add an attribute to an element, then use it in another template
From: Florent Georges <lists@xxxxxxxxxxxx>
Date: Wed, 5 Mar 2008 14:31:57 +0100 (CET)
Re:  add an attribute to an element
Pablo Sebastian Rodriguez wrote:

> with

> <music>
>     <project name="W.A.S.T.E.">
>         <release name="We all seek total entropy" year="2003"/>
>         <release name="Violent delights" year="2006"/>
>     </project>
> </music>

> i get

> attrName: name
> attrValue: W.A.S.T.E.

> if i had

> <music>
>     <project name="W.A.S.T.E." newThing="qwertyu">
>         <release name="We all seek total entropy" year="2003"/>
>         <release name="Violent delights" year="2006"/>
>     </project>
> </music>

> the result would be

> attrName: name
> attrValue: W.A.S.T.E

> attrName: newThing
> attrValue: qwertyu

    <xsl:template match="project/@*">
       <xsl:text>attrName: </xsl:text>
       <xsl:value-of select="name()"/>
       <xsl:text>&_#10;attrValue: </xsl:text>
       <xsl:value-of select="."/>
       <xsl:text>&_#10;&_#10;</xsl:text>
    </xsl:template>

    <xsl:apply-templates select=".../project/@*"/>

  Regards,

--drkm
























      _____________________________________________________________________________ 
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail http://mail.yahoo.fr

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.