|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Add an element to the result xml document
Hello Lynda,
hmm, I are copying in the wrong way. From the root context you are copying everything, you should copy node by node. You can read at http://www.w3.org/TR/xslt#copying how identity transformation can look like: <xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>Then you only need to add further template matching on <MessageID/> and say there, that you want to have it twice in the output: <xsl:template match="MessageID">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>Regards, Joerg LVanvleet@xxxxxxxxxx wrote: I have sucessfully copied all the elements in source xml to result xml but I also want duplicates of some elements. In the partial xml doc below I want the result to contain two copies of the <MessageID> and </MessageID> elements. 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








