Author |
Message
|
MSV |
Posted: Thu May 24, 2007 7:53 am Post subject: Setting xml attributes in MRM domain |
|
|
Acolyte
Joined: 11 Apr 2006 Posts: 59
|
Hello,
I am trying the following code in MB Version 5.
Code: |
SET OutputRoot.MRM.(XML.XmlDecl) = '';
SET OutputRoot.MRM.(XML.XmlDecl).(XML."Version") = '1.0';
SET OutputRoot.MRM.(XML.XmlDecl).(XML."Encoding") = 'UTF-8';
Getting a ParserException BIP5502E: An Common Parser Interface internal error occurred: Diagnostic information: Empty tag name when creating a SearchDef object. |
After going thru few related topics in the forum, suggested solution i found for this issue is a 3 step process
1)RCD to parse to xml ,
2)Add attributes in a compute,
3)RCD to parse back to MRM
But, I cant increase the number of nodes in my message flow
Is there any other alternative for resolving this issue ? |
|
Back to top |
|
 |
kimbert |
Posted: Thu May 24, 2007 5:07 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
You cannot use (XML.XmlDecl) or indeed (XML.anything) with the MRM domain. The MRM parser is controlled by the contents of the message set, not by the Type field in the message tree.
In v5, you cannot change the contents of the XML declaration which the MRM parser outputs - there are no properties in the message set for that. So you have two choices:
a) Forget about using MRM for output. Use the XMLNS domain instead.
b) Do what you described in your post.
I would go for a). |
|
Back to top |
|
 |
simon.starkie |
Posted: Wed Jan 27, 2010 6:28 am Post subject: |
|
|
Disciple
Joined: 24 Mar 2002 Posts: 180
|
kimbert wrote: |
You cannot use (XML.XmlDecl) or indeed (XML.anything) with the MRM domain. The MRM parser is controlled by the contents of the message set, not by the Type field in the message tree.
In v5, you cannot change the contents of the XML declaration which the MRM parser outputs - there are no properties in the message set for that. So you have two choices:
a) Forget about using MRM for output. Use the XMLNS domain instead.
b) Do what you described in your post.
I would go for a). |
Thanks, I wish I'd seen this earlier.
It's exactly the same problem I had.
I happened to switch from MRM to XMLNSC.
And then later found the above ESQL from another source.
Worked like a charm.
The reason why I needed the XML DECL in the output XML is because the product I am interfacing with, the GAL component our Perficient logging product, requires the XML DECL otherwise it considers the message to be a BLOB (yeah, not the best way of determining XML, especially since the XML DECL is optional anyway).
I was really stumped with MRM but switched to XMLNSC and then found the above ESQL from someone else and it worked like a charm.
I would like to have kept MRM for reasons of consistency (a shop standard to always use MRM instead of the other parsers, especially not XML if it can be avoided).
Any chance IBM could perhaps consider making the coding of the XML DECL available for MRM?
Another possibility would be an enhancement to the the Message Set implementation such that the generation of the XML DECL could be specified there and so avoid the need to code the above ESQL?
Thanks. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Jan 27, 2010 7:00 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
I would like to have kept MRM for reasons of consistency (a shop standard to always use MRM instead of the other parsers, especially not XML if it can be avoided). |
The rule should be 'MRM for non-XML formats, XMLNSC for XML'.
Quote: |
Any chance IBM could perhaps consider making the coding of the XML DECL available for MRM? |
Yes. But the chance of it happening is ~0% Seriously, MRM XML is no longer being enhanced. XMLNSC is the strategic XML parser.
Quote: |
Another possibility would be an enhancement to the the Message Set implementation such that the generation of the XML DECL could be specified there and so avoid the need to code the above ESQL? |
If that was ever done, the new info in the message set would be used by XMLNSC, not by MRM XML. Don't interpret that as anything other than what it is - a discussion of possibilities. |
|
Back to top |
|
 |
simon.starkie |
Posted: Wed Jan 27, 2010 9:01 am Post subject: |
|
|
Disciple
Joined: 24 Mar 2002 Posts: 180
|
kimbert wrote: |
Quote: |
I would like to have kept MRM for reasons of consistency (a shop standard to always use MRM instead of the other parsers, especially not XML if it can be avoided). |
The rule should be 'MRM for non-XML formats, XMLNSC for XML'.
Quote: |
Any chance IBM could perhaps consider making the coding of the XML DECL available for MRM? |
Yes. But the chance of it happening is ~0% Seriously, MRM XML is no longer being enhanced. XMLNSC is the strategic XML parser.
Quote: |
Another possibility would be an enhancement to the the Message Set implementation such that the generation of the XML DECL could be specified there and so avoid the need to code the above ESQL? |
If that was ever done, the new info in the message set would be used by XMLNSC, not by MRM XML. Don't interpret that as anything other than what it is - a discussion of possibilities. |
Thank you so much for answering our questions and providing us with some very good guidance.
We've had an on-going debate here about which parser to use, some like MRM or others like myself prefer XMLNSC.
Your valuable comments makes it alot easier to define a best practice shop standard to use XMLNSC in preference over MRM and certainly over XML.
Thanks and Cheers! |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jan 27, 2010 10:55 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Don't know about 5.0, but in 6.0 the xml setup of the message set allows you to specify the output or suppression of the xml declaration...
Look to the XML specific settings in the message set. Apart from that as Kimbert said, you're better off with XMLNSC...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
simon.starkie |
Posted: Wed Jan 27, 2010 5:52 pm Post subject: |
|
|
Disciple
Joined: 24 Mar 2002 Posts: 180
|
fjb_saper wrote: |
Don't know about 5.0, but in 6.0 the xml setup of the message set allows you to specify the output or suppression of the xml declaration...
Look to the XML specific settings in the message set. Apart from that as Kimbert said, you're better off with XMLNSC...  |
Yes, I had looked at the "XML Declaration" in the "XML Wire Formats" > "XML1" tag but all the default options seemed correct for generating the XML DECL I wanted, for example the "Supress XML Declaration" box unchecked, XML Version was 1.0, XML Encoding was "As document text" and "Standalone Document wasset to "Yes".
So the ESQL above achieved the desired result but only with XMLNSC as Kimbert mentioned. It's interesting to see MRM fade a bit considering it was the flagship in 1999, but as Kimbert said, MRM is good for other non-XML things.
Thanks. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jan 28, 2010 12:35 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
It's interesting to see MRM fade a bit considering it was the flagship in 1999 |
I've faded a bit in the last 11 years myself. I might even have been the 'strategic choice' back then. Must ask my wife about this... |
|
Back to top |
|
 |
|