• 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

Handling of elements inside choice by JAXB

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ???
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic