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 » IBM MQ Java / JMS » Parsing TextMessages.

Post new topic  Reply to topic
 Parsing TextMessages. « View previous topic :: View next topic » 
Author Message
ganesh3
PostPosted: Thu May 04, 2006 5:17 am    Post subject: Parsing TextMessages. Reply with quote

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
View user's profile Send private message Yahoo Messenger
jefflowrey
PostPosted: Thu May 04, 2006 5:34 am    Post subject: Reply with quote

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
View user's profile Send private message
msukup
PostPosted: Thu May 04, 2006 6:52 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Parsing TextMessages.
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.