Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can we generate a XML from XSD using SAX

 
Bhavin Parekh
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pls help me in exploring the SAX parser, and do tell me whether we can generate a XML file from a XML schema using SAX like we do using DOM and castor objects, or is SAX just used for the sole purpose of parsing
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can generate a stream of events that mimic the output of a SAX parser and use them to create XML documents.
I know of no way to automatically use XSD, that requires programming on your part to combine your data with the XSD structure information.

I did this article on "pipeline" processing of SAX events.
There are some tricky concepts here. Fortunately, Elliot Rusty Harold has placed this chapter from his big XML book online. Read that first.

Bill
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64683
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Bhavin B P",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic