posted 19 years ago
I have come to a point using the xslt in which I can get the "order" of the nodes preserved ie the "started" element occurs before the "drillOutDir" element but the attributes nodes for the started element are not preserved. Its skipped.
The current xslt looks like --
<xsl:template match="abc:configuration">
<xsl:copy>
<xsl:copy-of select="@*[local-name() != 'rmi' and local-name() != 'locale']"/>
<xsl:attribute name="useMgmt">
<xsl:text>true</xsl:text></xsl:attribute>
<xsl:attribute name="metadata"><xsl:text>true</xsl:text></xsl:attribute>
<xsl:apply-templates>
<xsl:sort select="boolean(self::server)" order="descending"/>
</xsl:apply-templates>
</xsl:copy>
<xsl:text></xsl:text>
</xsl:template>
<xsl:template match="server">
<xsl:element name="drillOutDir">
<xsl:value-of select="abc:configuration/drillOutDir"/>
</xsl:element>
<xsl:element name="started">
<xsl:copy-of select="@status[. = 'true' ]"/>
<xsl:value-of select="../abc:configuration/started"/>
</xsl:element>
</xsl:template>
<xsl:template match="abc:configuration/started">
<xsl:apply-templates/>
</xsl:template>
If I change this xslt to remove the started element from the server node and have a tranform for it separately then I do not even get the started node in the output xml.
What changes can I do to the above xslt in order to get
started node as in
<started status ="true"></started>
instead of what I m getting now ie
<started></started>
Thanks much.
[ February 21, 2005: Message edited by: N Bhonsle ]