• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XSD to XML generation

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please anyone, I really need help. Any pointers? I need to start with the development.

Regards,
Vijay.
 
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
You save more money with a clothesline than dozens of light bulb purchases. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic