OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Inconsistent behaviour, obviously correct schema doesn't work anymore

[ Lists Home | Date Index | Thread Index ]
  • To: xml-dev@lists.xml.org
  • Subject: Inconsistent behaviour, obviously correct schema doesn't work anymore
  • From: wagi_ch@gmx.net
  • Date: Fri, 29 Oct 2004 20:26:15 +0200 (MEST)
  • References: <24232.1098487208@www44.gmx.net>

Hi
First time using any mailing list, so i hope everythings correct...

I have the following problem: i let xmlspy generate a schema from a
sample-xml file with all the elements i need and then manually modified it.
it worked great until i had to reinstall xmlspy, now the files won't
validate with the very same schema!? if anyone can discover the error in the
schema i'd be very happy because, to me, everything looks quite ok.
(the <list> element is causing the error, xmlspy says "element 'list' is
undefined", the same happens with all the elements defined in
"DocumentElementsType")

schema:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema";>
	<!-- Beginn Typdefinition Inhaltselemente -->
	<xs:complexType name="DocumentElementsType" mixed="true">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<!-- Dropdown-Steuerelemente -->
			<xs:element name="dropdown">
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="xs:string">
							<xs:attribute name="alignment" type="xs:NMTOKEN" default="left">
								<xs:simpleType>
									<xs:restriction base="xs:NMTOKEN">
										<xs:enumeration value="left"/>
										<xs:enumeration value="center"/>
										<xs:enumeration value="right"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:attribute>
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
			<!-- Zitate -->
			<xs:element name="quote"/>
			<!-- Listen -->
			<xs:element name="list">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="listitem" type="DocumentElementsType"
maxOccurs="unbounded"/>
					</xs:sequence>
					<xs:attribute name="type" use="optional" default="unordered">
						<xs:simpleType>
							<xs:restriction base="xs:NMTOKEN">
								<xs:enumeration value="ordered"/>
								<xs:enumeration value="unordered"/>
							</xs:restriction>
						</xs:simpleType>
					</xs:attribute>
				</xs:complexType>
			</xs:element>
			<!-- Tabelle -->
			<xs:element name="table">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="header">
							<xs:complexType>
								<xs:sequence>
									<xs:element name="column" type="DocumentElementsType"
maxOccurs="unbounded"/>
								</xs:sequence>
							</xs:complexType>
						</xs:element>
						<xs:element name="row" maxOccurs="unbounded">
							<xs:complexType>
								<xs:sequence>
									<xs:element name="column" type="DocumentElementsType"
maxOccurs="unbounded"/>
								</xs:sequence>
							</xs:complexType>
						</xs:element>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
			<!-- Bilder -->
			<xs:element name="image">
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="xs:string">
							<xs:attribute name="src" type="xs:string" use="required"/>
							<xs:attribute name="description" type="xs:string" use="required"/>
							<xs:attribute name="border" type="xs:string" use="optional"/>
							<xs:attribute name="margin" type="xs:string" use="optional"/>
							<xs:attribute name="position" type="xs:NMTOKEN" use="optional"
default="left"/>
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
			<!-- Links -->
			<xs:element name="link" type="linkType"/>
		</xs:choice>
	</xs:complexType>
	<!-- Ende Typdefinition Inhaltselemente -->
	<!-- Beginn Typdefinition Paragraphinhalt (separiert wg. Attribut "title")
-->
	<xs:complexType name="paraType">
		<xs:complexContent>
			<xs:extension base="DocumentElementsType">
				<xs:attribute name="title" type="xs:string" use="required"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!-- Ende Typdefinition Paragraphinhalt -->
	<!-- Beginn Typdefinition Link -->
	<xs:complexType name="linkType">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="href" type="xs:anyURI" use="required"/>
				<xs:attribute name="destination" use="required">
					<xs:simpleType>
						<xs:restriction base="xs:NMTOKEN">
							<xs:enumeration value="inbound"/>
							<xs:enumeration value="outbound"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:attribute>
				<xs:attribute name="target" use="optional">
					<xs:simpleType>
						<xs:restriction base="xs:NMTOKEN">
							<xs:enumeration value="this"/>
							<xs:enumeration value="new"/>
							<xs:enumeration value="popup"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:attribute>
				<xs:attribute name="desttype" use="optional" default="html">
					<xs:simpleType>
						<xs:restriction base="xs:string">
							<xs:enumeration value="html"/>
							<xs:enumeration value="pdf"/>
							<xs:enumeration value="jpeg"/>
							<xs:enumeration value="gif"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:attribute>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<!-- Ende Typdefinition Link -->
	<!-- Dokument -->
	<xs:element name="document">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="meta">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="title" type="xs:string"/>
							<xs:element name="abstract" type="xs:string"/>
							<xs:element name="date" type="xs:string"/>
							<xs:element name="keyword" type="xs:string"/>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:element name="body">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="picture">
								<xs:complexType>
									<xs:attribute name="src" type="xs:string" use="required"/>
								</xs:complexType>
							</xs:element>
							<xs:element name="heading" type="xs:string"/>
							<xs:choice>
								<xs:element name="para" type="paraType" maxOccurs="unbounded"/>
								<xs:element name="customdata">
									<xs:complexType>
										<xs:simpleContent>
											<xs:extension base="xs:string">
												<xs:attribute name="data" type="xs:string" use="required"/>
												<xs:attribute name="schema" type="xs:string" use="required"/>
												<xs:attribute name="template" type="xs:string" use="required"/>
											</xs:extension>
										</xs:simpleContent>
									</xs:complexType>
								</xs:element>
							</xs:choice>
							<xs:element name="links" minOccurs="0">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="link" type="linkType" maxOccurs="unbounded"/>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
							<xs:element name="script" minOccurs="0"/>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>

xml:

<?xml version="1.0" encoding="UTF-8"?>
<document>
	<meta>
		<title/>
		<abstract/>
		<date/>
		<keyword/>
	</meta>
	<body>
		<picture src="bannerimage://asdf.jpg"/>
		<heading>someheading</heading>
		<para title="asdf">text</para>
		<para title="hgl">text</para>
		<para title="dgh">text 
			<list type="unordered">
				<listitem>text</listitem>
				<listitem>text</listitem>
				<listitem>text</listitem>
			</list>
		</para>
	</body>
</document>





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS