Trouble with placing xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" correct in the output xml file.
Posted: Mon Jan 06, 2025 11:17 am
I'm trying to place xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" statement here:
But it is placed at the end like this:
This is some of my xslt file:
Does anyone know how to get the output correct?
Code: Select all
<EG401.TRANSACTION [b]xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" [/b]xs:noNamespaceSchemaLocation="/aspect4/businessconnector/schemas/EGLDT/EG405.ACCOUNT.ACC.xsd" type="ABCSchema" time="120101" stock="0" runtype="*PROD" languages="95 97 07 91 00" id="DOCUMENT" group="7" docuniqueid="Q2024122040" date="20241220" company="735" >
Code: Select all
<EG401.TRANSACTION xs:noNamespaceSchemaLocation="/aspect4/businessconnector/schemas/EGLDT/EG405.ACCOUNT.ACC.xsd" type="ABCSchema" time="120101" stock="0" runtype="*PROD" languages="95 97 07 91 00" id="DOCUMENT" group="7" docuniqueid="Q2024122040" date="20241220" company="735" [b]xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"[/b]>
Code: Select all
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes" omit-xml-declaration="no" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"/>
<!--
2024.10.08 Lars Carlsson - Initial version
General rule for templates: select on xml-names from tpl_fields.xml.
-->
<xsl:variable name="belop-11v2">#0.00</xsl:variable>
<xsl:decimal-format name="belop" decimal-separator="."/>
<xsl:template match="/">
<xsl:text> </xsl:text>
<EG401.TRANSACTION>
<xsl:attribute name="xs:noNamespaceSchemaLocation">/aspect4/businessconnector/schemas/EGLDT/EG405.ACCOUNT.ACC.xsd</xsl:attribute>
<xsl:attribute name="type">ABCSchema</xsl:attribute>
<xsl:attribute name="time">120101</xsl:attribute>
<xsl:attribute name="stock">0</xsl:attribute>
<xsl:attribute name="runtype">*PROD</xsl:attribute>
<xsl:attribute name="languages">95 97 07 91 00</xsl:attribute>
<xsl:attribute name="id">DOCUMENT</xsl:attribute>
<xsl:attribute name="group">7</xsl:attribute>
<xsl:attribute name="docuniqueid">Q<xsl:value-of select="//transaction/bilagsdato"/><xsl:value-of select="//transaction/runnr"/></xsl:attribute>
<xsl:attribute name="date"><xsl:value-of select="//transaction/bilagsdato"/></xsl:attribute>
<xsl:attribute name="company"><xsl:value-of select="//transaction/firmaid"/></xsl:attribute>
<xsl:text> </xsl:text>