• 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

XML Schema to Java object

 
author
Posts: 469
20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello guys

I was trying to do something like this:
Read an XML Schema file and creat a Java object. The generated Java object contains information on which element types exist in the Schema, their possible attributes, the sub-elements it can contain, the attributes which are optional, the attributes which are required, etc etc. I mean this Java object will be the single point of contact for me to know everything about XML Schema.

Anyone can suggest me or provide some sample code to how to accomplish this kind of requirement ??

Looking forward to receive replies from you guys.

regards
ashish sarin
 
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well i'm just a green horn about this stuff, but i think the RELAXNG tool will generate JAVA classes!

bc
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JAXB was designed specifically to do this -- check out the Web Services Developer Kit on the Java website.
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One more http://www.castor.org/xmlschema.html
 
bob connolly
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does anyone know which of these tools, JAXP, Castor or other, are currently being used the most to generate Schema's or build Schema's from scratch these days?

I've just been reading artilces on 'xml.com' where the W3C XML Schema approach is being compared to the RELAX NG approach and it sounds like the RNG approach is more flexible and easier to develop, does anyone have any thoughts or experience with these tools?

What i'm really hoping to find is a tool that will help me build a 'detailed' Schema and by that i mean a tool that will ask which field i want to 'enumerate' and then go ahead and insert the 'enumerations' in the Schema automatically!

For example, if i say i want to 'enumerate' the state field in the Schema, the tool will examine a database or XML file, determine the unique data values for the state field and insert an 'enumeration' entry for each state into the Schema!

Will JAXP or CASTOR help build a 'detailed' Schema along those lines or even a 'shell/template' Schema for that matter?

I have been able to generate a generic 'shell' Schema using Oracles XML kit and Oracle DB, but i havn't been able to verify if i will have to pay a licensing fee if i move it to production!

Thanks for any thoughts!
bc
 
I don't always make ads but when I do they're tiny
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic