My input xml looks like this as given below
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<L1>
<L2>
<l3>
<item>
<State>1</state>
<currency>
<value1 xmlns:xs="www.anotherexample.com">5</value1>
<value2 xmlns:xs="www.anotherexample.com">dd</value2>
</currency>
</item>
<item2>
<a>1</a>
<b>2</b>
<c>3</c>
</item2>
<item3>
<e>2</e>
<l>3</l>
<m>3</m>
</item3>
<item4>
<n>r</n>
<p>5</p>
</item4>
</l3>
</L2>
</L1>
i have two requirements
1) the xml has to be added with an envelope ie another xml will sit on top of this whole xml and resultant should look like
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<start>
<a></a>
.....
.....
<Body>
<Envelope>
<L1>
<L2>
<l3>
<item>
<State>1</state>
<currency>
<value1 xmlns:xs="www.anotherexample.com">5</value1>
<value2 xmlns:xs="www.anotherexample.com">ca</value2>
</currency>
</item>
<item2>
<a>1</a>
<b>2</b>
<c>3</c>
</item2>
<item3>
<e>2</e>
<l>3</l>
<m>3</m>
</item3>
<item4>
<n>r</n>
<p>5</p>
</item4>
</l3>
</L2>
</L1>
</Envelope>
</Body>
.....
.....
</start>
2 the second requirment is that the root tag of the original xml ie the L1 tag should have a namespace added to it so the root tag becomes
<start>
<a></a>
.....
.....
<Body>
<Envelope>
<L1 xmlns="www.example.com">
<L2>
<l3>
<item>
<State>1</state>
<currency>
<value1 xmlns:xs="www.anotherexample.com">5</value1>
<value2 xmlns:xs="www.anotherexample.com">ca</value2>
</currency>
</item>
<item2>
<a>1</a>
<c>3</c>
</item2>
<item3>
<e>2</e>
</item3>
<item4>
<n>r</n>
</item4>
</l3>
</L2>
</L1>
</Envelope>
</Body>
</start>
how do we design an xslt to do this combination of transformation. i have searched and found solutions for adding namespace to the root tag, but how can i achieve both the results simulataneously
note: There are many elements inside the input xml that will be ignored or processed by using call template, so directly copying the xml and adding namespace fails in this case
example: i may be wanting only 1 tag from the input in the output xml. Edited the original post to show that the original input xml is not intended to be copied as it is to the output , as shown in the new output, the output xml will be in variation with the input XML with several tags missing and the order of the tags have to be constant Sorry for the incomplete description previously