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 » Parse bitstream with CDATA section on it

Post new topic  Reply to topic
 Parse bitstream with CDATA section on it « View previous topic :: View next topic » 
Author Message
Jenum
PostPosted: Thu Feb 28, 2013 2:30 am    Post subject: Parse bitstream with CDATA section on it Reply with quote

Novice

Joined: 13 Nov 2012
Posts: 24

Hello!
I have another question:
I need to parse bitstream, which contains well-formatted xml structure with CDATA section. For example:

Code:
<root>
    <a>
        <![CDATA[<b><c><d>]]>
    </a>
</root>


It is to parse bit stream:

Code:
CREATE LASTCHILD OF element.DocBody DOMAIN 'XMLNSC' PARSE(source.File.FileBody OPTIONS FolderBitStream);


Then, I need to convert it back to bitstream:

Code:
CAST(ASBITSTREAM(element.DocBody CCSID 1208) AS CHARACTER CCSID 1208);


This is all work good. But have one problem - it resulting in such string:

Code:
<root>
    <a>
        &lt;b&gt;&lt;c&gt;&lt;d&gt;
    </a>
</root>


It is meaning, that broker lose information about CDATA in tag and convert special symbols (such as < > & ...) in it image.
How i can avoid this?..

P.S. Sorry for my English I would be thanks, if you specify on my mistakes
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Feb 28, 2013 2:46 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

XMLNSC remembers that the data came from a CData section, and it will generate a CData section in the output. So you must have done something to the message tree after parsing. Did you copy it to the Environment or LocalEnvironment, perhaps?

I suggest that you put in at least two Trace nodes : the first one should go immediately after the CREATE...PARSE statement. You should see that the parser-specific field type is set to 'XMLNSC.CDataField' on element 'a'. Then put another Trace node just before the ASBITSTREAM. You will probably find that the XMLNSC.CDataField on element 'a' has disappeared because your flow has copied the tree incorrectly.
Back to top
View user's profile Send private message
Jenum
PostPosted: Thu Feb 28, 2013 5:55 am    Post subject: Reply with quote

Novice

Joined: 13 Nov 2012
Posts: 24

Thank you!
I really copy parsed tree in another non-xml structure.
When i make this structure as xml - it is work!

Thank you very much!
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 » Parse bitstream with CDATA section on it
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.