Posted: Wed May 14, 2008 4:03 am Post subject: Attributes rendered as elements with MRM (XML wire format)
Novice
Joined: 31 Oct 2006 Posts: 14
Hi
What i would like to achieve in Output XML is something like this:
<m:Data>
<crm:Body>
<ms:Element1 name="male">0</ms:Element>
<ms:Element2 name="en">4</ms:Element>
<ms:Element3 name="H" />
....
</crm:Body>
</m:Data>
ESQL looks like this:
SET OutputRoot.MRM[1].m:Data.crm:Body.ms:element1 = 0;
SET OutputRoot.MRM[1].m:Data.crm:Body.ms:element1.name = 'male';
SET OutputRoot.MRM[1].m:Data.crm:Body.ms:element2 = 4;
SET OutputRoot.MRM[1].m:Data.crm:Body.ms:element2.name = 'EN';
SET OutputRoot.MRM[1].m:Data.crm:Body.ms:element3.name = 'H';
All of the ms:Element[n] are of the same type which defines the attribute "name". Strangest think is that few of the <ms:Element> nodes are rendered correctly as XML but the rest aren't. And they all are of the same type.
I found few similar cases in the forums but not the solution. I'm using MB6.1.
ESQL looks like this:
SET OutputRoot.MRM[1].m:Data.crm:Body.ms:element1 = 0;
SET OutputRoot.MRM[1].m:Data.crm:Body.ms:element1.name = 'male';
SET OutputRoot.MRM[1].m:Data.crm:Body.ms:element2 = 4;
SET OutputRoot.MRM[1].m:Data.crm:Body.ms:element2.name = 'EN';
SET OutputRoot.MRM[1].m:Data.crm:Body.ms:element3.name = 'H';
Use (XML.Attribute) in the set statement
SET OutputRoot.MRM[1].m:Data.crm:Body.ms:element1 = 0;
SET OutputRoot.MRM[1].m:Data.crm:Body.ms:element1(XML.Attribute).name = 'male';
SET OutputRoot.MRM[1].m:Data.crm:Body.ms:element2 = 4;
SET OutputRoot.MRM[1].m:Data.crm:Body.ms:element2.(XML.Attribute)name = 'EN';
SET OutputRoot.MRM[1].m:Data.crm:Body.ms:element3.(XML.Attribute)name = 'H';
No. Do not use XML domain constants with the MRM parser.
Never ever ever do this.
In fact, please don't use the XML domain for anything.
Adjust the physical properties of the message model to correctly render these fields. _________________ I am *not* the model of the modern major general.
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