File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes Handling of elements inside choice by JAXB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Handling of elements inside choice by JAXB" Watch "Handling of elements inside choice by JAXB" New topic
Author

Handling of elements inside choice by JAXB

Balamurugan Balasubramanian
Greenhorn

Joined: Jun 07, 2006
Posts: 2
I have an element whose definition is like this.
<!ELEMENT JMXNode (NodeName, JMXServiceURL?, (JMXNode | MBean)*)>

When I generated JAXB classes using XJC compiler for this,
the JMXNode.java file generated for this element has only one list for all the child elements, irrespective of whether it is mandatory, optional, or choice.
This is creating issues when I tried to unmarshall this element. This also allows me to validate an invalid XML.

I am using JAXB version 1.0. Any thoughts on this issue ???
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2921
    
    5
Originally posted by Balamurugan Balasubramanian:
I have an element whose definition is like this.
<!ELEMENT JMXNode (NodeName, JMXServiceURL?, (JMXNode | MBean)*)>

I am using JAXB version 1.0. Any thoughts on this issue ???



JAXB 1.0 consumes XML Schema not DTD.

Java Architecture for XML Binding (JAXB) FAQs

Q. What happened to the JAXB implementation that supported DTD schema?[

The early access release that implemented working draft v0.21 in the JAXB specification is no longer available for download. The expert group for JAXB has taken the specification in a very different direction then the old version and it is not backwards compatible. Consequently, we discontinued distribution of the old version. As a result, the best option for those who used the old version would be to move their code base to the latest version of the JAXB reference implementation.

We realize that this is an inconvenience. However, one of the great strengths of the Java Community Process is the excellent compatibility that it affords. In order to maintain that compatibility we put very strict terms on EA technologies. Once a technology has completed the JCP you can have confidence that the final version will be supported and will be compatible.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Handling of elements inside choice by JAXB
 
Similar Threads
MessageDrivenBean - JAXB
Identifying elements inside choice by JAXB
JAXB 1.0.2 Unmarshal error, 'unexpected root element'
jaxb xml parsing, null pointer for IDRef element
JAXB - Ordering of elements in generated XML