• Post Reply Bookmark Topic Watch Topic
  • New Topic

JAXB java 2 XSD  RSS feed

 
Veshnu Ramakrishnan
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Is it possible to convert existing java files into XSD. If so please let me know how
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Starting with JAXB 2.0 (requiring JSE 5.0) there will be some support for mapping existing Java to generated XML Schema. See JSR-000222 JavaTM Architecture for XML Binding (JAXB) 2.0

1.2 Goals
...
2. Binding existing Java classes to generated XML schema
This addresses application scenarios where design begins with Java classes rather than an XML schema. One such example is an application that exports itself as a web service that communicates using SOAP and XML as a transport mechanism. The marshalling of Java object graph is according to program annotations, either explicit or defaulted, on the existing Java classes.
...
1.3 Non-Goals
...
  • Object graph traversal

  • Portable mechanisms to traverse a graph of JavaBean objects will not be addressed in JAXB 2.0.
  • Mapping any existing Java classes to any existing XML schema

  • The JAXB annotation mechanism is not sophisticated enough to enable mapping an arbitrary class to all XML schema concepts.


    However some issues will require support from the developer in the source code; e.g. preservation of referential integrity of an object graph across XML serialization followed by a XML de-serialization through use of @XmlID and @XmlIDREF (8.2.7 Referential Integrity).

    I expect that "XML Schema to Java" will remain the least problematic.
    [ February 20, 2006: Message edited by: Peer Reynders ]
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!