Community
Participate
Working Groups
Using the following example schema I generated JAXB classes. The resulting package-info.java does not define the namespace in the @XmlSchema annotation. If you go to the ObjectFactory and edit the "foo" XmlElementDecl to make the name invalid you will not get a validation error. Now go to the package-info.java and add namespace="bat" to the @XmlSchema annotation. Now you get validation on the XmlElementDecl. bat.xsd: <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:ns0="bat" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="bat" elementFormDefault="qualified"> <xsd:element name="foo" nillable="true"> <xsd:complexType> <xsd:sequence> <xsd:element name="bar" type="xsd:int"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema>
In this scenario, there is no validation to be done. The generation generates a package which technically creates xml that validates against the schema, but it does not associate the package with a namespace such that a schema can be associated with the package. Technically correct, tools-wise a nightmare.
Marking as invalid for now...please reopen if necessary.