Dear members
I am new to the world of XML and XSL transformation, i hope someone can help me with this XSL transformation
for an XML. I am not geting the expected result as described below
The following is the XML that I am trying to transform to another XML format using the XSL file also describe below
canceljob.xml
<?xml version = "1.0"?>
<?xml-stylesheet type="text/xsl" href="canceljob.xsl"?>
<MSG_CGI_CANCELJOB ID = "WMIS-965931" SRC_SYSTEM_CODE = "WMIS" SRC_SYSTEM_INSTANCE = "WMIS">
<CANCELJOB:CMP_CGI_CANCELJOB xmlns:CANCELJOB = "CANCELJOB" >
<CANCELJOB:ACTIONCODE>1</CANCELJOB:ACTIONCODE>
<CANCELJOB:AGENCYCODE>DAILYWORK</CANCELJOB:AGENCYCODE>
<CANCELJOB:CANCEL_DATE>07/01/2010</CANCELJOB:CANCEL_DATE>
<CANCELJOB:CANCEL_REASON>CUST</CANCELJOB:CANCEL_REASON>
<CANCELJOB:CREATIONDATETIME>2010-01-07 12:07:05.505</CANCELJOB:CREATIONDATETIME>
<CANCELJOB:EXTERNALNUMBER>308106</CANCELJOB:EXTERNALNUMBER>
<CANCELJOB:JOBNUMBER>133222</CANCELJOB:JOBNUMBER>
</CANCELJOB:CMP_CGI_CANCELJOB>
</MSG_CGI_CANCELJOB>
The following is the XSL file to perform the translation
canceljob.xsl XSL File
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"/>
<xsl:template match="/">
<CANCELJOB environment="Test">
<ApplicationArea>
<CREATIONDATETIME><xsl:value-of select="@CREATIONDATETIME"/></CREATIONDATETIME>
</ApplicationArea>
<DataArea>
<Job>
<AGENCYCODE><xsl:value-of select="@AGENCYCODE"/></AGENCYCODE>
<Closure>
<ACTIONCODE><xsl:value-of select="@ACTIONCODE"/></ACTIONCODE>
</Closure>
<ExternalNumbers>
<EXTERNALNUMBER><xsl:value-of select="@EXTERNALNUMBER"/></EXTERNALNUMBER>
</ExternalNumbers>
<JOBNUMBER><xsl:value-of select="@JOBNUMBER"/></JOBNUMBER>
</Job>
</DataArea>
</CANCELJOB>
<xsl:apply-templates />
</xsl:template>
</xsl:stylesheet>
The following is the resulting XML file that I am expecting
<CANCELJOB environment="Test">
<ApplicationArea>
<CREATIONDATETIME>2010-01-07 12:07:05.505308106</CREATIONDATETIME>
</ApplicationArea>
<DataArea>
<Job>
<AGENCYCODE>DAILYWORK</AGENCYCODE>
<Closure>
<ACTIONCODE>1</ACTIONCODE>
</Closure>
<ExternalNumbers>
<EXTERNALNUMBER>308106</EXTERNALNUMBER>
</ExternalNumbers>
<JOBNUMBER>133222</JOBNUMBER>
</Job>
</DataArea>
</CANCELJOB>
but the result i am getting is
1DAILYWORK07/01/2010CUST2010-01-07 12:07:05.505308106133222
Appreciate any assistant members can provide
Thanks
awofesof