Wednesday, May 11, 2005

copy xml document via xslt.

Few months back, one guy stopped by office & asked me I want .xsl file to copy the incoming xml file. At first I am bit shocked why you want to do that, later he explained the scenario. Immediately I got confused how to ? but did it in 10 minutes. But a crazy scenario. here is code for that part.

.lt. xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" .gt.
-- match the root node and copy it --
.lt. xsl:template match="/" .gt.
.lt. xsl:copy-of select="."/ .gt.
.lt./xsl:template .gt.

.lt./xsl:stylesheet.gt.

.lt. less than symbol .gt. greater than symbol

No comments: