Author |
Message
|
santy |
Posted: Thu Feb 05, 2009 11:30 pm Post subject: Conversion of SWIFT messages to XML through XSLT |
|
|
Centurion
Joined: 03 Nov 2006 Posts: 141
|
Hi,
I'm working on WMB 6.0.
My task is to convert incoming SWIFT 566 message to XML with XSLT.
The problem I'm facing is,
SWIFT 566 message contains D2 block which is repetating, I have to write an XSLT for that.
Scenario is - If D2 block is getting repetaed more that once in incoming message, how can I write an XSLT which will form more that one D2 block.
For e.g.
If SWIFT 566 message contains 3 D2 blocks (Cashmove blocks)-
16R:CASHMOVE
-------
-------
16S:CASHMOVE
16R:CASHMOVE
-------
-------
16S:CASHMOVE
16R:CASHMOVE
-------
-------
16S:CASHMOVE
the corresponding XML output through XSLT will be -
<cashmove>
---------
---------
<cashmove>
<cashmove>
---------
---------
<cashmove>
<cashmove>
---------
---------
<cashmove>
As I'm very new to XSLT, I'm looking for your help.
Thanks. |
|
Back to top |
|
 |
zpat |
Posted: Fri Feb 06, 2009 12:44 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
I thought XSLT was used to transform XML to XML?
http://www.w3.org/TR/xslt
If converting Swift FIN 15022 messages to XML, the traditional way would be to define a TDS message set for the input and then generate XML as the output message.
IBM provide a suitable TDS message set. Support pac IA0T (not free). |
|
Back to top |
|
 |
kimbert |
Posted: Fri Feb 06, 2009 12:56 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
My task is to convert incoming SWIFT 566 message to XML with XSLT. |
I am not an expert in XSLT, but I know a little about SWIFT messages and they are not simple to parse. XSLT is not a general-purpose programming language.
I agree with zpat. There is a message set available for doing this. Or you could model it yourself using the SWIFT sample as a starting point. Or you could write your parser in Java or C. Any of those options is likely to be a lot easier than using XSLT. |
|
Back to top |
|
 |
dominik.schweers |
Posted: Mon Feb 09, 2009 3:10 am Post subject: |
|
|
Novice
Joined: 23 Oct 2008 Posts: 17
|
Have a look at this:
http://wife.sourceforge.net/index.php?page=home
Its a Open Source Library that can parse SWIFT MT into an Java Object Tree. There is also a Writer that can serialize this Object Tree to XML. Doing so only needs few lines of Java Code.
The resulting XML can be handled via XSLT.
If you really want to follow this approach, I would try it like this. |
|
Back to top |
|
 |
zpat |
Posted: Mon Feb 09, 2009 3:49 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
I would look at the Swift sample that comes with WMB (see the info center) - adapting this would make sense.
However you can also treat these messages as BLOB and extract the relevant tags/data using ESQL logic.
If you are only looking for a couple of tags this would be easier than defining a message set (unless you know a lot about TDS). |
|
Back to top |
|
 |
|