ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » DTD in an XML file

Post new topic  Reply to topic
 DTD in an XML file « View previous topic :: View next topic » 
Author Message
bpugh
PostPosted: Fri Nov 18, 2005 10:18 am    Post subject: DTD in an XML file Reply with quote

Novice

Joined: 27 Apr 2004
Posts: 24
Location: St. Louis, MO

I have a new message flow that is receiving an XML file that contains the DTD built into it. When I manually remove the DTD, everything works fine. If I leave it in there, I get nothing. I have trace nodes connected to every possible terminal and yet I get no output when I leave the DTD in the file. The XML looks like

<?xml version="1.0"?>
<!DOCTYPE testfile [
<!ELEMENT testfile (error, (fld1 | fld4 | fld5)*)>
<!ELEMENT error (#PCDATA)>
<!ELEMENT fld1 (fld2, fld3?)>
<!ELEMENT fld2 (#PCDATA)>
<!ELEMENT fld3 (#PCDATA)>
<!ELEMENT fld4 (#PCDATA)>
<!ELEMENT fld5 (#PCDATA)>
<!ELEMENT fld6 (#PCDATA)>]>
<testfile>
<error>0</error>
<fld1>
<fld2>abc</fld2>
<fld3>xyz</fld3>
</fld1>
<fld6>def</fld6>
</testfile>

My message flow is pretty simple. It looks like

MQInput ---> Compute -----> MQOutput

with trace nodes coming off of every failure & catch terminal. As I said, I get nothing when I put a message through that contains the DTD.

My ESQL looks like this. Basically, what happens is "NbrOfRecs" always resolves to zero when the DTD is included, so it never gets into the loop. If I leave the DTD out, "NbrOfRecs" resolves to the right number and it works fine.

CREATE COMPUTE MODULE TestMsgFlow_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
DECLARE NbrOfRecs INTEGER CARDINALITY(InputBody.testfile.fld1[]);
DECLARE X INTEGER;

CALL CopyMessageHeaders();

SET X = 0;
WHILE X < NbrOfRecs DO
SET X = X + 1;
. . Reformats the message from XML to COBOL & propagates to outq
END WHILE;
RETURN FALSE;
END;

CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;
END MODULE;

Any help would be appreciated!

Bob
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Nov 18, 2005 10:20 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

First, don't put trace nodes on failure terminals. Leave them unconnected.

Second, look at the broker log for errors after you run another message through - if failure terminals are connected, you won't get errors.

Third, enable broker user tracing and see what that says.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
JT
PostPosted: Fri Nov 18, 2005 11:02 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

When you include a DOCTYPE declaration in your input message, you must specify that the XML element you're attempting to parse is not part of the declaration. You do this like so:

Code:
DECLARE NbrOfRecs INTEGER CARDINALITY(InputBody.(XML.Element)testfile.fld1[]);
Back to top
View user's profile Send private message
bpugh
PostPosted: Fri Nov 18, 2005 11:11 am    Post subject: Reply with quote

Novice

Joined: 27 Apr 2004
Posts: 24
Location: St. Louis, MO

That did the trick! Thanks Jeff & JT for your help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » DTD in an XML file
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.