[jdom-interest] Schema validation

Paul Carter paulc at objectif.com.au
Thu Feb 15 19:33:56 PST 2001


I am trying to validate an xml docuemnt against a schema when parsing. I
have no problems validating against a dtd but when I change to a schema I
get the following error:

org.jdom.JDOMException: Element type "ULLPreQualificationRequest" must be
declared.: Error on line 2: Element type "ULLPreQualificationRequest" must
be declared.

Could anyone give me a clue as to what the problem may be???  XML document
and schema are attached.

Thanks

Paul Carter
Objectif Telecmmunications Ltd



XML SCHEMA:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema">
	<xsd:element name="ULLPreQualificationRequest">
		<xsd:annotation>
			<xsd:documentation>Comment describing your root
element</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="RequestId" type="xsd:string"/>
				<xsd:element name="ServiceNo" type="xsd:string" maxOccurs="unbounded"/>
				<xsd:element name="Address">
					<xsd:complexType>
						<xsd:sequence>
							<xsd:element name="Locale" type="xsd:string"/>
							<xsd:element name="Type" type="xsd:string"/>
						</xsd:sequence>
					</xsd:complexType>
				</xsd:element>
				<xsd:element name="LineSpeed" type="xsd:integer"/>
				<xsd:element name="ServiceType" type="xsd:string"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
</xsd:schema>


XML DOCUMENT:


<?xml version="1.0" encoding="UTF-8"?>
<ULLPreQualificationRequest
xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="D:\XMLStuff\Examples\ULLPreQualificationReque
st.xsd">
	<RequestId>iou123</RequestId>
	<ServiceNo>99883434</ServiceNo>
	<ServiceNo>99883434</ServiceNo>
	<Address>
		<Locale>AU</Locale>
		<Type>ACIFSTREET</Type>
	</Address>
	<LineSpeed>123</LineSpeed>
	<ServiceType>Test</ServiceType>
</ULLPreQualificationRequest>




More information about the jdom-interest mailing list