Posted: Tue Jul 27, 2004 1:00 am Post subject: MRM XML Attribute Problem
Disciple
Joined: 21 Jul 2004 Posts: 150 Location: South Africa, JHB
Work Done:
- I'm using WMQI 2.1 CSD 07 on Windows 2000.
- I've imported two XSD's into the MRM (Input and Output Msg)
- All the attribute fields are set to render as XMLAttribute (I've double checked this)
Mappings SET "OutputRoot"."MRM"."Prod"."ProdType" = "InputBody"."Product"."PType";
SET "OutputRoot"."MRM"."Prod"."Action" = "InputBody"."Product"."Action";
SET "OutputRoot"."MRM"."Prod"."ProductID" = "InputBody"."Product"."ProductID";
SET "OutputRoot"."MRM"."Prod"."Notes"."NoteType" = "InputBody"."Product"."Notes"."NoteType";
SET "OutputRoot"."MRM"."Prod"."Notes"."SeqNbr" = "InputBody"."Product"."Notes"."SeqNbr";
SET "OutputRoot"."MRM"."Prod"."Notes"."Note" = "InputBody"."Product"."Notes"."Note";
Output Message PRODUCED <?xml version="1.0"?>
<ProductList>
<Prod>
<ProdType>PType</ProdType>
<Action>Action</Action>
<ProductID>ProductID</ProductID>
<Notes NoteType="NoteType" SeqNbr="SeqNbr">
<Note>This is a note</Note>
</Notes>
</Prod>
</ProductList>
Output Message EXSPECTED <?xml version="1.0"?>
<ProductList>
<Prod ProdType="PType">
<Action>Action</Action>
<ProductID>ProductID</ProductID>
<Notes NoteType="NoteType" SeqNbr="SeqNbr">
<Note>This is a note</Note>
</Notes>
</Prod>
</ProductList>
Problem - The <ProdType>PType</ProdType> renders as an XML Element instead of the exspected <Prod ProdType="PType"> attribute although it is defined in the MRM to render as XMLAttribute.
- The <Notes NoteType="NoteType" SeqNbr="SeqNbr"> renders properly though.
Any ideas on why one attribute will appear as an element while all the other renders as expected?
The most likely reason is that 'ProdType' is being treated as self-defining . If the broker cannot match ProdType to an element in the model, there's nothing to tell it that ProdType is supposed to be rendered as an attribute.
Without seeing your model I cannot say for sure.
To see whether I'm right, set 'Type Content' on all Complex Types and Groups to 'Closed' and switch on validation in your message flow. If you start getting validation errors, make sure that your model matches your input message.
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