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 » Preserving XML Tags

Post new topic  Reply to topic
 Preserving XML Tags « View previous topic :: View next topic » 
Author Message
goldym
PostPosted: Tue Oct 18, 2005 9:49 am    Post subject: Preserving XML Tags Reply with quote

Centurion

Joined: 24 Jun 2005
Posts: 116

MQInput Node-->Compute Node (Calls Java program to uncomress file. It also saves the Uncompressed data in an Environment variable) -->RCD (Reset to XML)-->MQOutput node

I have a message flow that calls a java program that Uncompresses an xml message. I had to output the Uncompressed message from Blob to string and put the output in the environment.

I then used a RCD node to Reset to XML and then retrieve the data from the environment.variable in the next node. However two things go wrong.

1. It adds an extra root element.
2. The parser converts my <data> tags to the &lt;/data&gt; (escaped characters)

Does anyone know how i would remove the extra root tag and preserve the XML tags. I guess I need to wrap the data in some kind of CDATA block. Not sure how to do that.

any ideas?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Oct 18, 2005 9:53 am    Post subject: Re: Preserving XML Tags Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

goldym wrote:
I had to output the Uncompressed message from Blob to string and put the output in the environment.
Why?

goldym wrote:
1. It adds an extra root element.
Why? Your code does this, not the parser.
goldym wrote:
2. The parser converts my <data> tags to the &lt;/data&gt; (escaped characters)

Well, because it doesn't think it's XML.

goldym wrote:
any ideas?

The typical way to take a string of XML data that has been retrieved from some source and turn it into a logical message tree is to use CREATE FIELD with the PARSE and DOMAIN options.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
goldym
PostPosted: Tue Oct 18, 2005 10:24 am    Post subject: Reply with quote

Centurion

Joined: 24 Jun 2005
Posts: 116

Hi Jeff,

Yes my code does add the extra field b/c I didn't know how to put it in a queue without setting it like that. Where do I need to do the CREATE FIELD when I am trying to access my environment.variables ?

Uncompress Node:

DECLARE OUTCHAR CHARACTER;
DECLARE IRROOT REFERENCE TO InputRoot.BLOB;
DECLARE P1 BLOB;
-- CALL CopyMessageHeaders();
-- CALL CopyEntireMessage();
-- call java
SET P1 = IRROOT.BLOB;
CALL DoUncompress(P1) INTO OUTCHAR;
IF P1 = NULL THEN
RETURN FALSE;
END IF;

CALL CopyMessageHeaders();
SET Environment.XML.UNCOMPRESSED = OUTCHAR;
-- change COMPRESS FLAG
SET OutputRoot.MQRFH2.usr.COMPRESSED = 'FALSE';
RETURN TRUE;
END;

Reset to XML:

Next Node:

SET OutputRoot.XML.Dummy = Environment.XML.UNCOMPRESSED;
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Oct 18, 2005 10:26 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

goldym wrote:
Next Node:

SET OutputRoot.XML= CREATE FIELD ..... PARSE ....Environment.XML.UNCOMPRESSED;

_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
goldym
PostPosted: Tue Oct 18, 2005 1:30 pm    Post subject: Reply with quote

Centurion

Joined: 24 Jun 2005
Posts: 116

[quote="jefflowrey"][quote="goldym"]Next Node:

SET OutputRoot.XML= CREATE FIELD ..... PARSE ....Environment.XML.UNCOMPRESSED;[/quote][/quote]


Thanks Again Jeff,

I can not figure out this syntax because the help said not to use a PArse clause with the field qualifier.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Oct 19, 2005 3:28 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Sorry.

Leave out FIELD.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
goldym
PostPosted: Wed Oct 19, 2005 4:33 am    Post subject: Reply with quote

Centurion

Joined: 24 Jun 2005
Posts: 116

--PARSE--(--BitStreamExpression--+------------------------------+--)--|

My data is in an Environment.Variable do i need to Set this to a bit stream? In order to use the Create Parse clause?
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 » Preserving XML Tags
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.