Re: Class generator
Alexandre Santos <[email protected]>
| Newsgroups | gmane.comp.java.jdom.general |
|---|---|
| Message-ID | <CAC0pG5Ybt2MrT4oKy-ux3sZiyEx42YGD1hY_O1uTC0i9CtQhRg@mail.gmail.com> |
Hello Rolf, I've been doing some experiments with a software called EditiX that can creates Java classes from a XML file. I've used JDOM on those classes to accomplish what I've been trying. The description of the solution I've figured out is here: www.alexandre-santos.com/Cars2Java.html Alexandre On Wed, Dec 14, 2011 at 3:08 PM, Rolf <[email protected]> wrote: > Hi Alexandre > > You seem to be stating two different requirements: > 1. output data in XML according to a schema > 2. 'generate Java classes for JDOM' > > In answer to 'outputting XML according to a schema': JDOM is not designed > to (easily) build an XML document that matches an XSD schema. The best you > can do is to build up an XML document in JDOM, then 'stream' it through an > XSD validating parser to make sure it conforms to the schema validations. > JDOM does not provide an 'easy' way to do this. > > On the second issue, I don't think I understand the request... you mention > JAXB and XMLBeans as if you want to serialize/deserialize (any) Java > classes as XML... or do you specifically want to know whether you can get > JDOM to run on Java 1.2.1 ? > > JDOM 1.1.2 should run fine on Java 1.2.1 (although I do not actually have > a Java 1.2.x environment to test in), but JDOM does not provide any special > tools for serializing/deserializing any Java classes. JDOM is not like > XMLBeans or JAXB. It cannot do that for you. > > Hope this helps (though I don't think JDOM will be very useful for either > of those issues). > > Rolf > > > On 14/12/2011 9:06 AM, Alexandre Santos wrote: > >> Hi! I'm involved in a project were I need to output data in XML >> according to a XSD Schema. Is there a tool to generate Java classes for >> JDom? The project uses Java 1.2.1 (yes, very old) and I can't use those >> newer things like JAXB or XMLBeans... >> Alex >> >> >> ______________________________**_________________ >> To control your jdom-interest membership: >> http://www.jdom.org/mailman/**options/jdom-interest/** >> [email protected]<http://www.jdom.org/mailman/options/jdom-interest/[email protected]> >> > > _______________________________________________ To control your jdom-interest membership: http://www.jdom.org/mailman/options/jdom-interest/[email protected]