• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XML Parser

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hai all,
Is there any need for separate XMLparser for jdk1.4.If it is available how to use the XML parser. How to set the class path and what are the methods to parse the XML document. What parser can we use(SAX, DOM etc.). My requirement is to send a XML request & retrive a XML response and parse it.
Thanks in advance.
Jithesh
 
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are using JDK 1.4, you do not need a separate parser, since JDK has in-built support for XML, and if I recall correctly, it uses crimson parser.
HTH,
- Manish
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My requirement is to send a XML request & retrive a XML response and parse it.
Just as an aside, you should understand that you may not even need an XML parser for this. Sure the document(s) are XML, but if all you need to do is extract a build a standard request with a small number of variable fields, and extract a small number of element values from a response, you might as well use Java's built-in string handling.
For example, something like:

I only suggest this because a full-fat XML parser is a heavyweight thing, and the code to use it will probably be much bigger and more complex than what I have given above. If you really do need an XML parser, I apologize for the interruption.
 
Ranch Hand
Posts: 3404
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Frank and Manish,
Is there any central place for information on when to use Java and when , XML ? It may also make learning of the two easier. Is JDK 1.4 the best place for this ?
regards
[ September 01, 2003: Message edited by: HS Thomas ]
 
Manish Hatwalne
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Frank Carver:
My requirement is to send a XML request & retrive a XML response and parse it.
I only suggest this because a full-fat XML parser is a heavyweight thing, and the code to use it will probably be much bigger and more complex than what I have given above. If you really do need an XML parser, I apologize for the interruption.


I wholeheartedly agree with Frank, make sure that your requirements justify use of XML. Quite often I have seen developers opting for XML parsers when even simple StringTokenizer would suffice.
- Manish
 
Jithesh Kozhipurath
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you friends,
I am looking at a software that will be compatible with all the programming languages so I am in need of XML. Now i want to work it with java, and may be i will change it to some other. And the data is retrived from a remote database, so I must use XML for the data transfer.
 
reply
    Bookmark Topic Watch Topic
  • New Topic