I have a query regarding mapping of 2 different namespace elements :
1).I get the undermentioned XML data from a 3rd party system:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<FIXML xmlns="http://www.fixprotocol.org/FIXML-4-4">
<Order Acct="1" ExDest="ExchDest">
<Hdr Snt="2007-04-05T13:34:47"/>
<Instrmt Issr="Barclays" MMY="200903"/>
</Order>
</FIXML>
2).The above XML element values need to be extracted and put in the format that we are currently using below with prefix 'i:'
Code:
<i:Interest xsi:schemaLocation="http://www.abc.com/interests:i http://abc/schemas/interests/interests.xsd" xsi:type="i:vanilla" xmlns:i="http://www.abc.com/interests:i" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:common="http://www.abc.com/common" xmlns:strategies="http://www.abc.com/strategies">
<i:ID>249403</i:ID>
<i:Generation>2</i:Generation>
<i:Entered Formatted="" Format="dd mmm yyyy hh:mm:ss">2007-04-02T18:34:43</i:Entered>
<i:Updated Formatted="" Format="dd mmm yyyy hh:mm:ss">2007-04-02T18:36:47</i:Updated>
<i:Description>EQ.D</i:Description>
3) I have written my XSL as follows:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:fix="http://www.fixprotocol.org/FIXML-4-4"
xmlns:i="http://www.abc,com/common/interests:i"
exclude-result-prefixes="fo i ">
<xsl:template match="fix:FIXML">
<xsl:apply-templates select="fix:Order"/>
</xsl:template>
<xsl:template match="fix:Order">
<OrderCancelRequest>
<i:ID>
<xsl:value-of select="@Acct"/>
</i:ID>
</OrderCancelRequest>
My Query is:
a) Do I need any mapping mechanism to read data from the XML defined in (1) in the format defined in (2).
If so,please can you suggest a way for this?
b) OR is it a wise idea to hardcode the elements with the prefix of 'i:' in my style sheet as I have done
in step (3)
Please can you advise.