convert xsd to xml

A

Arash

Hi!
simple problem (I spotted it a couple of times in different newsgroups
but no satifying solution could be found)

I want to create a "maximum" xml instance out of a schema (xsd)
automatically. Meaning that any optional Tag or Attribute should
appear in the instance. Unbounded Tags could appear e.g. once, or
twice...

A way to solve this problem could be JAXB by:

1. reading the xsd file into a JAXB object
2. use some magic to automatically fill the tag values
3. unmarshal the object to a XML file

I have two problems with this approach:

1. point (2.) above needs to be obviously worked out in more detail
2. I couldnt find a functioning JAXB plugin for ECLIPSE 3.0

so please, please help!
greetings, arash.
 
I

iksrazal

Hi!
simple problem (I spotted it a couple of times in different newsgroups
but no satifying solution could be found)

I want to create a "maximum" xml instance out of a schema (xsd)
automatically. Meaning that any optional Tag or Attribute should
appear in the instance. Unbounded Tags could appear e.g. once, or
twice...

A way to solve this problem could be JAXB by:

1. reading the xsd file into a JAXB object
2. use some magic to automatically fill the tag values
3. unmarshal the object to a XML file

I have two problems with this approach:

1. point (2.) above needs to be obviously worked out in more detail

Lots of tutorials out there walk you through this. I may be able to
help if you get stuck. Its a bit complicated to go through step by
step.
2. I couldnt find a functioning JAXB plugin for ECLIPSE 3.0

At least two choices here:

1) Wait for a JAXB plugin. Have a dependency issue if you ever are
asked to use another GUI. Even worse problems if you use revision
control.
2) Use Ant with JAXB. Very well documented. Run your Ant script in
Eclipse. It works everywhere.

Here's a couple links if you go that route.

http://www.onjava.com/pub/a/onjava/2002/03/06/jaxant1.html
http://www.onjava.com/pub/a/onjava/2004/05/05/jaxb.html?page=2

HTH

Outsource to an American programmer living in brazil!
http://www.braziloutsource.com/
iksrazal
 
I

iksrazal

Hi!
simple problem (I spotted it a couple of times in different newsgroups
but no satifying solution could be found)

I want to create a "maximum" xml instance out of a schema (xsd)
automatically. Meaning that any optional Tag or Attribute should
appear in the instance. Unbounded Tags could appear e.g. once, or
twice...

A way to solve this problem could be JAXB by:

1. reading the xsd file into a JAXB object
2. use some magic to automatically fill the tag values
3. unmarshal the object to a XML file

I have two problems with this approach:

1. point (2.) above needs to be obviously worked out in more detail

Lots of tutorials out there walk you through this. I may be able to
help if you get stuck. Its a bit complicated to go through step by
step.
2. I couldnt find a functioning JAXB plugin for ECLIPSE 3.0

At least two choices here:

1) Wait for a JAXB plugin. Have a dependency issue if you ever are
asked to use another GUI. Even worse problems if you use revision
control.
2) Use Ant with JAXB. Very well documented. Run your Ant script in
Eclipse. It works everywhere.

Here's a couple links if you go that route.

http://www.onjava.com/pub/a/onjava/2002/03/06/jaxant1.html
http://www.onjava.com/pub/a/onjava/2004/05/05/jaxb.html?page=2

HTH

Outsource to an American programmer living in brazil!
http://www.braziloutsource.com/
iksrazal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top