hi Mapraputa Is,
Thanks for your reply.Well! I merged two xml files using document('filename.xml').It works fine with following examples.But don't the same o/p on inserting cocoon pi and xsp declaration.
margin.xml
----------
<?xml version="1.0" encoding="UTF-8"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="merge.xsl" type="text/xsl"?>
<margin>
<margin1>5</margin1>
<margin2>10</margin2>
</margin>
style.xml
---------
<?xml version="1.0" encoding="UTF-8"?>
<?cocoon-process type="xslt"?>
<style>
<style1>
<cost>100</cost>
</style1>
<style2>
<cost>200</cost>
</style2>
</style>
merge.xsl
---------
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl

utput method="xml"/>
<!--load the merge file -->
<xsl:variable name="sty" select="document(
'style.xml')"/>
<!-- combine the files -->
<xsl:template match="/">
<style1>
<!-- select all the child nodes of the margin tag in
the main file -->
<xsl:for-each select="margin/child::*">
<!-- copy the margin tag -->
<xsl:copy-of select="."/>
</xsl:for-each>
<!-- and all the child nodes of the style tag in the
merge file -->
<xsl:for-each select="$sty/style/child::*">
<!-- copy the style tag -->
<xsl:copy-of select="."/>
</xsl:for-each>
</style1>
</xsl:template>
</xsl:stylesheet>
-------------------------
O/P : 5 10 100 200
-------------------------
But when I insert the cocoon pi and xsp namespace declaration in both of my xml files then the o/p is only from margin.xml file.
eg the changes made in my magin.xml files are -
margin.xml
----------
<?xml version="1.0" encoding="UTF-8"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<xsp : page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core">
<?xml-stylesheet href="merge.xsl" type="text/xsl"?>
<margin>
<margin1>5</margin1>
<margin2>10</margin2>
</margin>
</xsp : page>
-------------------------
O/P : 5 10
-------------------------
What changes r required to make in my merge.xsl file.
Thanks in advance.
Regards,
SHAILENDRA.
[This message has been edited by shailendra vasale (edited August 08, 2001).]