This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes XSD to XML generation Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "XSD to XML generation" Watch "XSD to XML generation" New topic
Author

XSD to XML generation

Vijay Raj
Ranch Hand

Joined: Oct 10, 2005
Posts: 110
Hi,

I am trying to read an XSD and generate xml based on it, tying together
data from a database. What are my technology options?

While googling, I read one option where I could use an XSD parser(like Xerces XML Schema API) and navigate thru the XSD and generate xml for each element. Are there any apis to generate elements into a DOM tree based on
XSD definitions?

I greatly appreciate if anyone who has done similar things could shed
some light on this.

Vijay.
Vijay Raj
Ranch Hand

Joined: Oct 10, 2005
Posts: 110
Please anyone, I really need help. Any pointers? I need to start with the development.

Regards,
Vijay.
Roseanne Zhang
Ranch Hand

Joined: Nov 14, 2000
Posts: 1953
I might be out of date, please tell me if I am wrong. Here are 2 answers I wrote several years ago.

http://bobcat.webappcabaret.net/javachina/faq/xml_01.htm#dtd_Q06

http://bobcat.webappcabaret.net/javachina/faq/xschema_01.htm#schema_Q04

Thanks!
Vijay Raj
Ranch Hand

Joined: Oct 10, 2005
Posts: 110
So do you say that I cannot generate XML depending upon the schema. The last statement in one of your posts "Then why we need the XML schema?" sounds fair.

Can I make a single XSD which covers all possible XML outputs(those legal in terms of my application), can I then generate the XML?

I was going through JAXB where in "xjc" was used to generate .java classes and then transformed to XML. I there anythign similar in Java 1.4 (xjc generates Java 5 code).

Regards,
Vijay.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17233
    
    1

Jerry, please refrain from advertising your product. All posts like that are moved to blatant advertising.

XMLSpy is a great program, but will not help the original poster as they are not looking to create xml docs through another program, but through Java code.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: XSD to XML generation
 
Similar Threads
XSD to XML java source code
Generating Schema from an XML file
XSD generation based on XML
Generating xsd based on xml
Generating xsd based on xml