Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Parsing xml file ??

 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all friends,
Iam new to XML I want to clear my some doubts how I can parse my xml file,I have created my own xml and dtd file.I have heard that there is only two ways of parsing xml file is it right ? if it is right then what are the two ways ?
Another question is validation and parsing are same thing ?
Thanks & Regards
Bikash
[ August 31, 2003: Message edited by: Bikash Paul ]
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I am new to XML I want to clear my some doubts how I can parse my xml file,I have created my own xml and dtd file.I have heard that there is only two ways of parsing xml file is it right ? if it is right then what are the two ways ?


You're probably talking about SAX and DOM. SAX is an event-based approach to parsing (i.e. the XML parser sends your application events when encountering elements, attributes, text nodes, etc.) while DOM is a document-based approach (the XML parser builds a complete document object hierarchy for you to navigate and pick the info you need).

Another question is validation and parsing are same thing ?


No. Parsing is the act of transforming a character stream/file/string/whatever into an XML document while validation is the act of checking that the resulting document follows the structure it should follow (i.e. compare the XML document to its DTD document).
 
Bikash Paul
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
First of all thanks for your reply.Can I parse my xml file using java and DOM parser.Can you plz give me some help link so that I can take help from there.I want to parse my xml file using java and DOM parser.
Thanks & Regards
Bikash
 
tumbleweed
Posts: 5089
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The The Java Developers Almanac 1.4 is always a great source for examples.
I do suggest however you first learn more about XML parsing before you proceed to parse you document using DOM. DOM aint easy. see XML Tutorial
It might also want to look at JDom
Good luck.
[ September 01, 2003: Message edited by: Johannes de Jong ]
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is also a JSR for a pull-based Streaming API for XML. Take a look at this article about the differences of these three in the Oracle Technology Network.
 
Bikash Paul
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Lots of thanks for all of ur's help.
Thanks & Regards
Bikash
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic