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 » Parsing XML with the WMQI Java Classes

Post new topic  Reply to topic
 Parsing XML with the WMQI Java Classes « View previous topic :: View next topic » 
Author Message
ResidualDream
PostPosted: Tue Apr 16, 2002 3:57 am    Post subject: Reply with quote

Newbie

Joined: 20 Mar 2002
Posts: 4

Hi,
Im having a problem with the creation of Java based plugin nodes. I can get them running fine but a need has arisen for me to take an XML document which is stored as a string and parse it for addition to the WMQI message which comes out of the output terminal. I can parse the message with SAX but can't seem to get the job done with the WMQI java classes as the functions dont seem to allow the addition of data parsed with SAX or alternatively its own independent parser.
Any help would be great,

Thanks,
Andy
Back to top
View user's profile Send private message MSN Messenger
dnaren
PostPosted: Tue Apr 16, 2002 11:18 am    Post subject: Reply with quote

Apprentice

Joined: 10 Aug 2001
Posts: 45
Location: Charlotte, NC

It's not easy to mix any independent parser output with the message represented by MbMessage object in Java plugin. It is not impossible though. You need to go through the painful process of making a new MbElement, set the value/attributes of the element, identify the postition of the new element in the result document and then add the element. Repeat this for each XML tag and value.

It's ridiculuous to follow this procedure for XML documents with large number of nodes. You will end up writing several lines of code. Java API for manipulating the message inside the node is soooooooooo inadequate.

I avoided using that API completely by extracting the message in the form of a Java String at the beginning. I am using SAX parser to parse the message/String. After processing the message, I am building another String to represent the outgoing message. I am sticking this String to the outgoing message and propagating it.



Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
ResidualDream
PostPosted: Tue Apr 16, 2002 11:36 pm    Post subject: Reply with quote

Newbie

Joined: 20 Mar 2002
Posts: 4

Thanks for that, im going to persevere, I dont quite understand your method im afraid, will this produce useable XML or just a string containing XML, if the latter can you parse this in WMQI without a DTD?

Thanks once again,

Andy
Back to top
View user's profile Send private message MSN Messenger
suneelsh
PostPosted: Wed Apr 17, 2002 3:39 am    Post subject: Reply with quote

Acolyte

Joined: 13 Apr 2002
Posts: 69
Location: Pune,India

You could also see the examples given in the rootexamplesJavaPlugincomibmsamples. There are two files TransformNode and SwitchNode. See the transform node to get basic idea how to parse the xml. The
java api docs are stored in the rootdocs directory
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Parsing XML with the WMQI Java Classes
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.