xsl-list
[Top] [All Lists]

Re: [xsl] add an attribute to an element, then use it in another template

2008-03-05 06:32:33
Pablo Sebastián 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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--