|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
< > - XML Conversion |
« View previous topic :: View next topic » |
Author |
Message
|
vmurali_au |
Posted: Tue Dec 26, 2006 12:11 pm Post subject: < > - XML Conversion |
|
|
 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[<n:Payload version="1.00" xmlns:n="http://www.mycomp.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<n:ResponseMessage>
<n:ResponseHeader>ABCD</n:ResponseHeader>
</n:ResponseMessage>
</n:Payload>]]>
</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 |
|
 |
jefflowrey |
Posted: Tue Dec 26, 2006 2:04 pm Post subject: |
|
|
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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|