Posted: Wed Jan 14, 2004 6:09 pm Post subject: unreadable XML tree when DocType = RootElement
Acolyte
Joined: 05 Aug 2003 Posts: 59 Location: Sydney, Australia
We have been given some sample XML messages from our client that they will be passing to us. When I tried to run these through our flows (MsgBrkv5.0) the message would parse ok and in the debugger I could see the tree and it looked fine.
However when I tried to reference a field in ESQL it could not find anything and would assume a null.
I traced the problem back to the fact that the DocType of the XML message was present but without a DTD. eg:
Changing the DocType to anything else (eg. MESSAGE or Massage) or deleting it meant that the tree could be read ok and the flow worked.
Has anyone seen this? Is it logical for the Broker to behave like this when a DTD is not present for 'Message'? How would you treat this even if the DTD did exist? - ie. how would the broker pick up the DTD (given that this is not using the MRM parser)
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
Can you post your ESQL coe where you are trying to refer to this element? _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
Joined: 05 Aug 2003 Posts: 59 Location: Sydney, Australia
Here's the relevant section of ESQL. With the DocType set to 'Message' and no DTD specified the lines referencing InputBody fail.
-----------------------------------------------
CREATE COMPUTE MODULE F01_RI_HANDLER
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
SET OutputLocalEnvironment = InputLocalEnvironment;
DECLARE line_feed BLOB CAST('0A' AS BLOB);
SET OutputRoot.Properties.MessageSet = 'K27R4V0002001';
SET OutputRoot.Properties.MessageType = 'TNT_FLAT_MSG';
SET OutputRoot.Properties.MessageFormat = 'TDS1';
SET OutputRoot.MRM.META_Msg.meta_header = 'MD';
SET OutputRoot.MRM.META_Msg.message_type = 'RI ';
SET OutputRoot.MRM.META_Msg.process_key = InputBody.Message.Route.Sender.Process;
SET OutputRoot.MRM.META_Msg.LF = line_feed;
SET OutputRoot.MRM.TNT_Msg.RI_Msg.record_indicator = 'HH';
SET OutputRoot.MRM.TNT_Msg.RI_Msg.order_type = TRIM(InputBody.Message.ReceivingInstruction.OrderType);
SET OutputRoot.MRM.TNT_Msg.RI_Msg.cust_order_number = TRIM(InputBody.Message.ReceivingInstruction.OrderNo);
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