Re: [xsl] Adding element to xml snippet using xslt

Subject: Re: [xsl] Adding element to xml snippet using xslt
From: "Joris Gillis" <roac@xxxxxxxxxx>
Date: Mon, 21 Feb 2005 22:48:21 +0100
Tempore 22:05:27, die 02/21/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Nishi Bhonsle <nishi.bhonsle@xxxxxxxxxx>:

make that:

<xsl:template match="server">
    <xsl:element name="drillOutDir">
        <xsl:value-of select="abc:configuration/drillOutDir"/
    <xsl:element name="started">
        <xsl:copy-of select="@status[. = 'true' ]"/>
        <xsl:value-of select="../abc:configuration/started"/>

Apparently, this results in the following output --

The status = true attribute of the started element does not show up?
The output for the started element should be --
<started status="true">This application was stopped.</started>

What could be wrong/missing in the above xslt?


Hi: Any updates on this?

The original part of the XML document is actually too limited too solve your problems. Could you include a more complete and well-formed snippet?

<abc:configuration xmlns:xsi=""; xsi:schemaLocation="
xmlns/abcst/configurationconfiguration.xsd" locale="en" webcache="false" rmi="true">
<started status="true"></started>

The 'status' attribute of the 'start' element is constructed by copying it from the 'server' node. Because this element has no 'status' attribute in the above XML, the 'started' element will not receive this attribute.

I don't understand were the text node 'This application was stopped.' should come from.

Joris Gillis (
Vincit omnia simplicitas
Keep it simple

Current Thread