Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes XML and Related Technologies and the fly likes create xml from xml schema in java Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "create xml from xml schema in java" Watch "create xml from xml schema in java" New topic
Author

create xml from xml schema in java

zb cong
Ranch Hand

Joined: Jan 14, 2002
Posts: 403
Hello

if can i create a xml document framework from xml schema in java, then i can fill the fields by DOM?

Thanks
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16479
    
    2

Again, that depends on what you mean by "framework".
zb cong
Ranch Hand

Joined: Jan 14, 2002
Posts: 403
in fact, i have the data in csv format from other system, and we need to write a app to transform it to xml format, i have the xml schemas for several formats, what we need to do is just to define some mapping machanism to implement the transformation programmably.
so i think first we need a program to create a empty xml file(have the well formed structure, but have not data) following the defination of the xml schema, then define the mappings to fill the empty xml file. but i find it is hard to find a mechanism to generate xml file from its schema by java.

can you help to this case?
thnaks
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12265
    
    1
Note that a schema probably does NOT define a unique XML document - many structures can be legal. For example with repeating elements.

This toolkit has some examples of various flat file to XML conversions.

Bill

Java Resources at www.wbrogden.com
zb cong
Ranch Hand

Joined: Jan 14, 2002
Posts: 403
Thanks. it looks helpful. let me try
 
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: create xml from xml schema in java
 
Similar Threads
XML Schema
XML Beans in Java
JAXB in eclipse
convert xml to java objects using JAXB
how to create Xml file programmatically