In the XSLT/XPath data model namespace declarations are not attributes, rather they are represented by namespace nodes.
When you create result elements or attributes you do not need to create any namespace declarations, rather you need to create the elements or attributes in the proper namespace and then the serializer will add any namespace declarations as needed.
So instead of
Code:
<xsl:template name="F4FDelvyNotif">
<xsl:element name="F4FDeliveryNotification">
<xsl:attribute name="xmlns:xsi">http://www.w3.org/2001/XMLSchema-instance</xsl:attribute>
<xsl:attribute name="xsi:noNamespaceSchemaLocation">http://www.first4farming.com/F4FXML/Schemas/v3_0_3/F4FDel.xsd</xsl:attribute>
you only need
Code:
<xsl:template name="F4FDelvyNotif">
<xsl:element name="F4FDeliveryNotification">
<xsl:attribute name="xsi:noNamespaceSchemaLocation" namespace="http://www.w3.org/2001/XMLSchema-instance">http://www.first4farming.com/F4FXML/Schemas/v3_0_3/F4FDel.xsd</xsl:attribute>
although I would use literal result elements instead to shorten the code:
Code:
<xsl:template match="F4FDelvyNotif">
<F4FDeliveryNotification xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.first4farming.com/F4FXML/Schemas/v3_0_3/F4FDel.xsd">