|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: XSL on attribute
> ...
> <xsl:template match="BoughtStuff">
> <BoughtStuff>
> <xsl:for-each select="Milk">
> <xsl:apply-template select="Brand" />
> </xsl:for-each>
> </BoughtStuff>
> ...
>
I take "preserve the value and the tag" to mean "preserve the attribute name
and its value".
So assuming what you are looking for is:
<BoughtStuff BestBefore="19May2000">Nestume</BoughtStuff>
then try:
....
<xsl:template match="BoughtStuff">
<BoughtStuff>
<xsl:attribute name="BestBefore">
<xsl:value-of select="Milk/@BestBefore"/>
</xsl:attribute>
<xsl:for-each select="Milk">
<xsl:apply-template select="Brand" />
</xsl:for-each>
</BoughtStuff>
....
</xsl:template>
....
Cheers,
Dr. Marc Beckers
Documentation Consultant
Software AG
Uhlandstraße 12
D-64297 Darmstadt
Phone +49-6151-92-1322
Fax -1612
mailto:Marc.Beckers@xxxxxxxxxxxxxx
http://www.softwareag.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








