• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML Parsing

 
Sindhu Kodoor
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am having a JMS application , where the publisher-subscriber model is used, and the subscriber is notified when a message comes into the queue, the messages picked up is xml files which are of large size. All that comes out of the subscriber program is the xml file name, which is a good parser to parse this xml?

And also if I am getting the structure of the xml as this :


If I need to pick up the value of project tag with the condition that the scheme should be "http:\\xxx\xyz\abc\one.html" then how would I write the syntax of the XPath?

I tried this :



this does not work .. please help!!
 
Paul Clapham
Sheriff
Posts: 21117
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All of that business about where the data comes from and how you get it is irrelevant to what parser you should use. What is relevant, however, is the part of your post about XPath expressions. If you plan to use XPath expressions then you should use a parser which supports XPath. As far as I know streaming parsers don't.

As for the expression, I'm amazed that somebody should decide to use identifiers which look sort of like HTTP URL's but use backslashes instead of slashes. What's up with that? Anyway your problem is simply that you're creating a Java string which attempts to include backslash characters but doesn't escape them properly. Nothing to do with XML at all. You need this:

 
Prabhakar Reddy Bokka
Ranch Hand
Posts: 197
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should use SAX parser to parse the xml.
SAX is event based. So, based on the condition you can get the value of the specific event/tag.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic