Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363931 - missing validation messages if package-info.java does not define XmlSchema namespace
Summary: missing validation messages if package-info.java does not define XmlSchema na...
Status: RESOLVED INVALID
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JAXB (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: dali.general-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-16 11:02 EST by Karen Butzke CLA
Modified: 2011-12-28 10:37 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.