Author |
Message
|
sboucher |
Posted: Mon Oct 27, 2003 5:44 pm Post subject: MRM Input - XML Output |
|
|
Acolyte
Joined: 27 Oct 2002 Posts: 52
|
Using MQSIv2.1 on WIN2k
Does the core functionality of MQSI support converting and MRM message set to XML output or do I need a separate support pac. I'm fooling around with the following sample message
FNAME
LENGTH 15 String
LNAME
LENGTH 30 String
I want to output this as XML. Any pointers appreciated for this newbie
Thanks
Scott _________________ Scott A. Boucher
Database Administartor |
|
Back to top |
|
 |
vmcgloin |
Posted: Tue Oct 28, 2003 3:11 am Post subject: |
|
|
Knight
Joined: 04 Apr 2002 Posts: 560 Location: Scotland
|
Yes. This is core functionality.
Take your existing message set, right-click on the top level and 'Add Physical Format...' 'XML Format...'. Then in an RCD node or compute node set the Message Format to XML. (Presumably you have CWF on your exiting MQInput node.)
e.g. in Compute node:
SET OutputRoot.Properties.MessageFormat = 'XML';
Put it to an MQOutput node and examine it on the queue.
The tags will by default be the element names, e.g FNAME & LNAME. You can modify the XML Format properties for each element in your message if you want the XML tag to change this. You might also want to change the Root Tag name at the message set level.
Hope that helps.
Vicky |
|
Back to top |
|
 |
sboucher |
Posted: Tue Oct 28, 2003 4:58 am Post subject: |
|
|
Acolyte
Joined: 27 Oct 2002 Posts: 52
|
I would like to raise the bar and add repeating fields as follows an have the ouput in XML:
Title
Publisher
Authors - Repeating Field
My thoughts are to use the MRM with the above as elements but don't know if there is one better physical layer than another to use. Physical layers is where I get confused in learning MQSI Messagesets. _________________ Scott A. Boucher
Database Administartor |
|
Back to top |
|
 |
kimbert |
Posted: Tue Oct 28, 2003 7:39 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
In case it helps...
MRM provides three physical formats:
XML is for XML messages
TDS is for just about any message which consists of text, but is not XML
CWF is for C or COBOL style binary messages which contain mostly fixed-length binary fields. Null terminated strings are also allowed.
Your logical model can have any or all of these physical formats added to it. Having added a physical format, you can control exactly how your data will get parsed and written in that format.
Example : If you wanted to input a message like this:
Title:How to Model Messages
Publisher:IBM
Authors:T. Kimber, S. Boucher
and you wanted to output this:
<bookDetails>
<TheBookTitle>How to Model Messages</TheBookTitle>
<Publisher>IBM</Publisher>
<Author>T. Kimber</Author>
<Author>S. Boucher</Author>
</bookDetails>
You would add two physical formats to your logical model - TDS and XML
If you preferred to output the XML like this:
<bookDetails title="How to Model Messages" publisher="IBM">
<Author>T. Kimber</Author>
<Author>S. Boucher</Author>
</bookDetails> |
|
Back to top |
|
 |
kimbert |
Posted: Tue Oct 28, 2003 7:41 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
...continued....accidentally hit 'Save'!
then you could twiddle with the XML rendering settings for elements 'title' and 'publisher'.
Hope that helps. |
|
Back to top |
|
 |
|