Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

SAX Dom parser  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
i am a new user for xml parser.
can anybody please tell me where i can get the sample code for SAX DOM parser so that i can convert my java files field into a xml file.
if anybody before this write code in SAX DOM parser for generating xml file from java code please tell me .
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are actually mixing up two kinds of XML parser. The SAX style parser makes a pass through an XML file, calling your custom code whenever it finds a tag or other important information. The DOM style builds a Document Object Model (DOM) in memory. Frequently, a SAX parser is at the core of the code that creates a DOM, but the DOM user does not see that.
There are plenty of parsers with source code - look at the
xml.apache.org site for one.
These parsers convert XML into Java - not the other way around. A program to convert Java code into XML would not be an XML parser.
Bill

------------------
author of:
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A program to convert Java code into XML would not be an XML parser....
Then what would it be called and how is it done. I want to be able to write Java that will become XML with different Schemas there is not a set one. My code should be able to be used for many types of schemas.
Thanks, mpap

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!