aspose file tools*
The moose likes Web Services and the fly likes Can we generate a XML from XSD using SAX Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Can we generate a XML from XSD using SAX" Watch "Can we generate a XML from XSD using SAX" New topic
Author

Can we generate a XML from XSD using SAX

Bhavin Parekh
Greenhorn

Joined: May 06, 2007
Posts: 1
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

Joined: Mar 22, 2000
Posts: 12803
    
    5
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

Joined: Jan 10, 2002
Posts: 61420
    
  67

"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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can we generate a XML from XSD using SAX