This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: "Query about retrieving attribute value as well as node value"
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: Re: [xsl] "Query about retrieving attribute value as well as node value"
- From: Jörg Heinicke <joerg dot heinicke at gmx dot de>
- Date: Mon, 1 Oct 2001 14:56:25 +0200
- References: <20011001052433.15811.qmail@web11706.mail.yahoo.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
XSL doesn't manipulate the source-document, but building a new one. So you
have in your output-document "in theory" many attributes with it's values
but no elements. You have to copy the element-nodes too. Look at the changed
XSL. Furthermore I changed the namespace as the other posters said already.
Joerg
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:template match="/">
> <xsl:apply-templates/>
> </xsl:template>
>
> <xsl:template match="root">
> <xsl:copy>
> <xsl:apply-templates/>
> </xsl:copy>
> </xsl:template>
>
> <xsl:template match="para">
> <xsl:copy>
> <xsl:for-each select="style">
> <xsl:attribute name="color">
> <xsl:value-of select="@color1"/>
> </xsl:attribute>
> <xsl:attribute name="size">
> <xsl:value-of select="@size1"/>
> </xsl:attribute>
> <xsl:attribute name="face">
> <xsl:value-of select="@face1"/>
> </xsl:attribute>
> <xsl:value-of select="."/>
> </xsl:for-each>
> </xsl:copy>
> </xsl:template>
>
> </xsl:stylesheet>
>
> Regards
>
> Bikash Paul
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list