This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: "Query about retrieving attribute value as well as node value"


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]