Here is a xslt that i have where I have two namespaces. When I transform an existing xml using this xslt, the output does not list both the namespaces at the top. It does not list the "xmlns:test" namespace at the top. Instead it lists the namespace for each extended element. for e.g.
<test:RecievingType xmlns:test="http://test/retail/ArtsPOSLogExt/">XGRF</test:RecievingType>
Do you know how I can fix this?
XSLT
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:test="http://test/retail/ArtsPOSLogExt/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns="http://www.nrf-arts.org/IXRetail/namespace/" xsi:schemaLocation="http://test/retail/ArtsPOSLogExt/ ArtsPOSLogExtForReceipt.xsd
http://www.nrf-arts.org/IXRetail/namespace/ POSLogV221.xsd">
<xsl:template match="/">
<xsl:element name="POSLog">
<xsl:attribute name="xsi:schemaLocation" >
http://test/retail/ArtsPOSLogExt/ ArtsPOSLogExtForReceipt.xsd
http://www.nrf-arts.org/IXRetail/namespace/ POSLogV221.xsd</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="/results/st">
<xsl:element name="Transaction">
<xsl:element name="RetailStoreID">
<xsl:value-of select="@RetailStoreID"/>
</xsl:element>
<xsl:element name="test:RecievingType">
<xsl:value-of select="@ReceivingType"/>
</xsl:element>
<xsl:element name="test:PackingSlip">
<xsl:value-of select="substring(@Comments ,5)"/>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
XML
<?xml version="1.0" encoding="utf-8"?>
<POSLog xsi:schemaLocation="http://test/retail/ArtsPOSLogExt/ ArtsPOSLogExtForReceipt.xsd
http://www.nrf-arts.org/IXRetail/namespace/ POSLogV221.xsd" xmlns="http://www.nrf-arts.org/IXRetail/namespace/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Transaction>
<RetailStoreID>3</RetailStoreID>
<test:RecievingType xmlns:test="http://test/retail/ArtsPOSLogExt/">XGRF</test:RecievingType>
<test:PackingSlip xmlns:test="http://test/retail/ArtsPOSLogExt/"></test:PackingSlip>
</Transaction>
</POSLog>