Source file
<?xml version="1.0" encoding="UTF-8"?>
<!--It will contain more data, just given few here-->
<Food>
<Menu>Item1</Menu>
</Food>
Require output:
<?xml version="1.0" encoding="UTF-8"?>
<Detail>
<SubDetail>
<Food>
<Menu>Item1</Menu>
</Food>
</SubDetail>
</Detail>
I would like to add the source xml(contains more than 200 lines) in between Detail and SubDetails. Could you please tell me how to write the xslt.
Just stating the obvious: Instead of explicit recursive copying, you could also use
<xsl:copy-of>command if you want to copy the selected node and all of its contents. Copying the whole input document inside<Detail>and<SubDetail>wrapper element can be done with one xsl command within one template. Your final use case is probably more complex, but the logic is the same.