|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Retain whitespaces after XML parsing in MRM domain |
« View previous topic :: View next topic » |
Author |
Message
|
billybong |
Posted: Tue Apr 22, 2008 6:04 am Post subject: Retain whitespaces after XML parsing in MRM domain |
|
|
 Disciple
Joined: 22 Jul 2005 Posts: 150 Location: Stockholm, Sweden
|
Hi all!
We're using a supplied messageset (ISF, internal standard format) with element wildcards for storing parts of our messages. The messages that arrives on our flow is parsed by our own messageset (SWIFT FIN) and translated into the common message format modelled in XML and later stored as a BLOB in a database field.
On flow exit, this entire BLOB field is read and parsed as XML by the MRM XML parser (ISF again) which strips our whitespace characters, i.e. the CR in CR/LF.
The message is then partly parsed into the exit messageset (SWIFT FIN) and type while some fields are simply added as BLOB data since they are not modelled in the FIN message.
Is there a way to force the MRM XML parser to retain XML whitespaces at parse time or do you have to model a CDATA field in our XML MRM fomat (ISF)? Since both of our messagesets are supplied by IBM we're reluctant to change these since we will have to remodel them for every following update.
I've seen some earlier posts stating that the MRM parser automatically removes all insignificant characters, is there a way to change that?
Broker v6.0
Sorry bout not being specific, just hoping someone could push me in the right direction.
As always, thanks for a great community! _________________ IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Integration Developer V6.0
IBM Certified System Administrator - WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere DataPower |
|
Back to top |
|
 |
kimbert |
Posted: Tue Apr 22, 2008 4:04 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
Is there a way to force the MRM XML parser to retain XML whitespaces at parse time? |
No, The MRM parser always discards whitespace/comments/processing instructions, and you cannot change that.
Note, however, that the XMLNSC parser creates a message tree which is similar in its structure to a tree built by the MRM parser. It does have an option for preserving mixed content, |
|
Back to top |
|
 |
billybong |
Posted: Wed Apr 23, 2008 4:11 am Post subject: |
|
|
 Disciple
Joined: 22 Jul 2005 Posts: 150 Location: Stockholm, Sweden
|
Thanks for the advice Kimbert. I've developed a workaround which suits fine. Basically we're parsing the parts that are delimited and store them in a correct message model with CR/LF's as separators.
This solved our problem and is the correct way to go. Wonderful how easily problems are solved when you take the time to do things the way theyre meant to be done....  _________________ IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Integration Developer V6.0
IBM Certified System Administrator - WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere DataPower |
|
Back to top |
|
 |
billybong |
Posted: Thu May 22, 2008 6:10 am Post subject: |
|
|
 Disciple
Joined: 22 Jul 2005 Posts: 150 Location: Stockholm, Sweden
|
Actually, this issue has rised up again in a scenario where we would like to store spaces in a field that's getting mapped to a standard format in xml. Consider the message below:
A
B
D
Where the third line includes a space (x'20 in ASCII). When our custom format parses this and maps it to an xml format the output string stored in database is.
<field>A</field>
<field>B</field>
<field> </field>
<field>D</field>
After parsing the string back using the mrm xml parser the third row will be parsed as an empty field which will result in an empty line once we map it to our output format again.
Is there a way to make the xml parsing still retain the blank space in the third field? I've tried changing the parser to XMLNS on the MessageSet but to no luck.
Thanks in advance! _________________ IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Integration Developer V6.0
IBM Certified System Administrator - WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere DataPower |
|
Back to top |
|
 |
kimbert |
Posted: Thu May 22, 2008 7:07 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
I've tried changing the parser to XMLNS on the MessageSet but to no luck. |
I'm not surprised. The 'Domain' setting on the message set is only used by the toolkit.
If you want to select a different runtime parser, you need to change the Domain property on the Input node. XMLNSC should work nicely. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|