[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Inconsistent behaviour, obviously correct schema doesn't w


xs nmtoken definition
Thank you very much, Ivan. That solved my problem! (I'm still not clear why
the my validator didn't catch the error in the schema, but that's another
part in the very obscure behaviour of computers ;) )

Michael

> I don't think the following definition is correct: you cannot define an
> anonymous SimpleType and use the type attribute at the same time.
> 
> <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>
> 
> 
> Validating Untitled2.xml...
> file:///c:/Temp/Untitled1.xsd:12,72: Attribute declarations may not
> contain both a type and a simpleType declaration
> 
> After removing the type attribute 
> 
> Xerces-J and XSV 2.7 pass, but Xerces-C, MSXML and .NET do not.
> 
> If you add mixed="true" to the "paraType" definition like that they all
> pass
> 
> <xs:complexType name="paraType" mixed="true">
> 
> Ivan
> 
> 
> > -----Original Message-----
> > From: wagi_ch@g... [mailto:wagi_ch@g...]
> > Sent: Friday, October 29, 2004 2:26 PM
> > To: xml-dev@l...
> > Subject:  Inconsistent behaviour, obviously correct schema
> doesn't work anymore
> > 
> > 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>
> > 
> > 
> > -----------------------------------------------------------------
> > The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> > initiative of OASIS <http://www.oasis-open.org>
> > 
> > The list archives are at http://lists.xml.org/archives/xml-dev/
> > 
> > To subscribe or unsubscribe from this list use the subscription
> > manager: <http://www.oasis-open.org/mlmanage/index.php>
> > 
> 
> 
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> 
> The list archives are at http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>
> 


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.