Schema with namespace declaration ...fails

Hi
i’ve got a problem while defining a schema, which should hold the following data:

  • ExportSupplier DEFAULT

In the quartz Element a defined 3 attributes:
overwrite-existing
xmlns
xmlns:xsi

When i try to define the schema, i got an error. Problem is about the namespaces i defined in the schema…

how can i define a schema for this document?
I need to store the quartz document as it is…including the namespace information. Im using Tamino 4.2.1

I’m not really clear from your description what you’re trying to do, but you should not define “xmlns” or “xmlns:xsi” as attributes in your schema. Although they look like attributes, they are not: they’re namespace declarations. In your schema you need to have appropriate namespace declarations, and the elements and attributes should be defined in the appropriate namespaces, and then it should work.

Also, each Schema document should only define elements in a single namespace. If (as it appears here) you have elements from different namespaces in a single instance document, you’ll need to create a Schema document for each namespace and use the import function to combine them.

Reto,

this would have been easier if you had sent the full XML document and the XML schema you tried. Nevertheless, I assumed that the full XML document was


<quartz overwrite-existing-jobs="true" xmlns="http://www.opensymphony.com/quartz/JobSchedulingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opensymphony.com/quartz/JobSchedulingData Untitled2.xsd">
	<job>
<job-detail>
			<name>ExportSupplier</name>
			<group>DEFAULT</group>
		</job-detail>
	</job>
</quartz>

In this case, the following schema definition holds:


<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="http://www.opensymphony.com/quartz/JobSchedulingData" xmlns:tns="http://www.opensymphony.com/quartz/JobSchedulingData" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.opensymphony.com/quartz/JobSchedulingData" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:element name="quartz ">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="job">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="job-detail">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="name" type="xs:string"/>
										<xs:element name="group" type="xs:string"/>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
			<xs:attribute name="overwrite-existing-jobs" type="xs:boolean"/>
		</xs:complexType>
	</xs:element>
</xs:schema>

If you want to wrap your document by a namespace-free element SupplierSchedulerConfig, you have to define a second schema that imports the schema above.
Hint: importing schemas are very much more conveniant in Tamino V4.4, so you should switch versions.

Regards

Harald