Subject: [xsl] add an attribute to an element, then use it in another template From: Pablo Sebastian Rodriguez <psrodriguez@xxxxxxxxxxxxxxxx> Date: Tue, 04 Mar 2008 16:26:14 -0200 |
hi, i'm new using xsl, so please be patient... ;-)
<project name="W.A.S.T.E"> <release name="We all seek total entropy" year="2003"/> <release name="Violent delights" year="2006"/> </project>
<project name="Winterkalte"> <release name="Structures of Destruction" year="1997"/> <release name="Drum 'n' noise" year="1999"/> </project>
<xsl:template match="music"> <xsl:call-template name="attr"> <xsl:with-param name="stuff" select="project"/> </xsl:call-template> </xsl:template>
<xsl:template name="attr"> <xsl:param name="stuff"/> <xsl:for-each select="$stuff/@*">
attrName: <xsl:value-of select="name()"/> attrValue: <xsl:value-of select="."/>
</xsl:for-each> </xsl:template>
attrName: name attrValue: W.A.S.T.E
attrName: name attrValue: Winterkalte
attrName: newThing attrValue: whoKnowsWhat
attrName: name attrValue: W.A.S.T.E
attrName: name attrValue: Winterkalte
attrName: adadad attrValue qwertyu
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] replacing diacritical mar, David Carlisle | Thread | RE: [xsl] add an attribute to an el, Wei, Alice J. |
RE: [xsl] Transform param name to t, Philipp Kursawe | Date | RE: [xsl] add an attribute to an el, Wei, Alice J. |
Month |