[Home] [By Thread] [By Date] [Recent Entries]
Hi I want have the following: <files> <supplier> ... </supplier> <customRows> .. </customRows> </files> Now, I want to copy customRows into supplier. I created the following code to do this: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sup="http://www.calypso.net.au/apps/supub/SupplierV1.0"> <xsl:template match="files"> <xsl:apply-templates select="sup:supplier"/> </xsl:template> <xsl:template match="sup:supplier">
<supplier>
<xsl:apply-templates select="@*|node()"/>
<supplementary>
<xsl:apply-templates select="../customRows"/>
</supplementary>
</supplier>
</xsl:template> <xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>Works fine, except it copies namespace information to children nodes that doesn't seem to exists. eg: <supplier xmlns:sup="http://www.calypso.net.au/apps/supub/SupplierV1.0"> <priority xmlns="http://www.calypso.net.au/apps/supub/SupplierV1.0" xmlns:dir="http://apache.org/cocoon/directory/2.0" xmlns:cinclude="http://apache.org/cocoon/include/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">1</priority> <name xmlns="http://www.calypso.net.au/apps/supub/SupplierV1.0" xmlns:dir="http://apache.org/cocoon/directory/2.0" xmlns:cinclude="http://apache.org/cocoon/include/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">BERJAYA EDEN PARK</name> <thumbNail xmlns="http://www.calypso.net.au/apps/supub/SupplierV1.0" xmlns:dir="http://apache.org/cocoon/directory/2.0" xmlns:cinclude="http://apache.org/cocoon/include/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">thumb.jpg</thumbNail> ... I have checked, these elements are not in the source document, and it only seems to affect the children of supplier. How can I keep the xmlns:xsi information for supplier, but not copy it into the children. Thanks. Any ideas? Cheers. Kamal. -- Kamal Bhatt Tourism Technology Pty Ltd
Level 10, 1 Pacific Highway, North Sydney, NSW 2060 http://www.tt.com.au
|

Cart



