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 » < > - XML Conversion

Post new topic  Reply to topic
 < > - XML Conversion « View previous topic :: View next topic » 
Author Message
vmurali_au
PostPosted: Tue Dec 26, 2006 12:11 pm    Post subject: < > - XML Conversion Reply with quote

Voyager

Joined: 26 Mar 2004
Posts: 76

I'm trying to parse the XML data with < > as an XMLNSC
The above escaped XML is in the CDATA section.

<ResponseText>
<![CDATA[&lt;n:Payload version="1.00" xmlns:n="http://www.mycomp.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" &gt;
&lt;n:ResponseMessage&gt;
&lt;n:ResponseHeader&gt;ABCD&lt;/n:ResponseHeader&gt;
&lt;/n:ResponseMessage&gt;
&lt;/n:Payload&gt;]]>
</ResponseText>

I've to parse the contents of CDATA as a XMLNSC payload.

I'm getting the MbParserException.

String payloadData = (String) outRoot.getFirstElementByPath("./ResponseText").getValue();
byte[] payloadBytes = payloadData.getBytes();

outRoot.createElementAsLastChildFromBitStream(payloadBytes,XMLNSC.PARSER_NAME,null,null,null,0,0,0);

I see that payloadData is containing XML string (with the escaped XML elements). payloadBytes is containing byte value of the characters in payloadData. But once i create the XMLNSC payload I'm getting the MbParserException.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Dec 26, 2006 2:04 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

a) I bet that you aren't getting quite what you think you're getting from getValue,
b) I bet you need to manually convert the entities back to normal characters.
_________________
I am *not* the model of the modern major general.
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 » &lt; &gt; - XML Conversion
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.