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 complexType vs anonymous complexType 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 "complexType vs anonymous complexType " Watch "complexType vs anonymous complexType " New topic
Author

complexType vs anonymous complexType

Rithanya Laxmi
Ranch Hand

Joined: Jan 24, 2011
Posts: 135
Hi,

I am using complexType in my XSD which doesnot generate the @XmlRootElement and will generate an ObjectFactory using JAXB XJC. Where the advantages i feel with complexType are :-

1) If an element is referenced in multiple XSD documents use it.
2) Better reusability
3) Supports multiple root level elements declarataion.

Please let me know what are the adv of using complexType in place of anonymous complexTypes?

Thanks.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: complexType vs anonymous complexType
 
Similar Threads
Unable to fully map ['http://url']:xxxInput using javax.xml.soap.SOAPElement
how can i create java classes from given wsdl
When to use complex types and when to use elements in creating wsdl files?
XSD Compliance with WebService and JAXB
root element to wrap all the complexType elements