|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Parsing TextMessages. |
« View previous topic :: View next topic » |
Author |
Message
|
ganesh3 |
Posted: Thu May 04, 2006 5:17 am Post subject: Parsing TextMessages. |
|
|
Apprentice
Joined: 30 Mar 2006 Posts: 35
|
Hi,
In my application, I need to parse the TextMessages that I recieve. The text messages contain xml tags. I am using a DOM parser for the same. But the parse() method od DOMBuilder requires either InputStream, InputSource or File as an input.I cannot use File as my application does not have permissions to create files. Kindly let meknow how i can parse the TextMEssages that I recieve. _________________ Have a Good Day!!! |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu May 04, 2006 5:34 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Maybe you should look closer at the JMS API for MQ and the Java API. Like, perhaps there is a subclass of InputStream, or InputSource that will do what you need from what you can get from the TextMessage.
At least, that's what I would do in your situation. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
msukup |
Posted: Thu May 04, 2006 6:52 am Post subject: |
|
|
Acolyte
Joined: 11 Feb 2002 Posts: 56
|
Ganesh,
See if this gets you going:
DOMParser parser = new DOMParser();
String txtInputMsg = "<?xml version . . . "; (or text from JMSTextMessage)
StringReader stringReader = new StringReader(txtInputMsg);
InputSource inputSource = new InputSource(stringReader);
Document doc = parser.parse(inputSource);
The key being InputSource rather than file as input to parse method.
InputSource comes from org.xml.sax.InputSource |
|
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
|
|
|
|