Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 363931

Summary: missing validation messages if package-info.java does not define XmlSchema namespace
Product: [WebTools] Dali JPA Tools Reporter: Karen Butzke <karenfbutzke>
Component: JAXBAssignee: dali.general-inbox <dali.general-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: enhancement    
Priority: P3 CC: neil.hauge, paul.fullbright
Version: 3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Karen Butzke CLA 2011-11-16 11:02:05 EST
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>
Comment 1 Paul Fullbright CLA 2011-11-16 11:31:21 EST
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.
Comment 2 Neil Hauge CLA 2011-12-28 10:37:36 EST
Marking as invalid for now...please reopen if necessary.