I am using "Attribute Value Templates" to transform and XML into another XML format. This is my XSLT:-
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
exclude-result-prefixes="xsi"
xmlns:ted="Report1"
>
<xsl:output method="xml" indent="yes" encoding="utf-8" />
<xsl:template match="/ted:Report">
<xsl:variable name="VersionNumber" select="ted:TUserInput/ted:Details_Collection/ted:Details/@VersionNumber" />
<xsl:variable name="Date1" select="ted:TUserInput/ted:Details_Collection/ted:Details/@Date1" />
<xsl:variable name="Date2" select="ted:TUserInput/ted:Details_Collection/ted:Details/@Date2"/>
<Root XSDVersion="{$XSDVersion}">
<Body>
<Intro VersionNumber="{$VersionNumber}"
Date1="{$Date1}}"
Date2="{$Date2}"/>
</Body>
</Root>
</xsl:template>
The transformation is happening however I have notices that the elements into the "Intro" tag are not being outputted into the order specified in the XSLT. E.g. VersionNumber, Date1 and Date2 but in a different order like sthe below:-
<?xml version="1.0" encoding="UTF-8"?>
<Root xmlns:ted="Report1" XSDVersion="01">
<Body>
<Intro Date2="2017-09-04" Date1="2017-09-13T13:57:16.86" VersionNumber="4"/></Body>
</Root>
What could it be that is causing this issue?