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

Re: misunderstanding of XML Schema ?


xml schema constant
This is because you have defined the Property element several times
within the same schema, with a different datatype each time.  XML Spy is
complaining on the second Property element because it expects it to be
of "DisplayPropertyType", but instead it is of "TypePropertyType".

According to your XML instance, it appears that Property has the same
content model on each occurrence.  You should probably just declare the
Property element once and use the "maxOccurs" facet on it, to make it
repeatable.

Hope that helps.

Joe Chiusano
Booz | Allen | Hamilton

> Bill Riegel wrote:
> 
> Trying to define a base type of PropertyType,
> 
> And derived several types from this base type. Where the name element
> is restricted to a fix list in each derived type.
> 
> 
> 
> Have a file that should have a list of these derived types in a
> specific order.
> 
> 
> 
> In XML spy when I try to validate the file it complains that the
> second Property entry does not have DisplayName, when it has a Type.
> 
> 
> 
> Why does it think all Property entires are DisplayPropertyType's ??
> 
> 
> 
> XML File
> 
> 
> 
> <ComponentRegistry>
> 
>   <Components>
> 
>     <Component name="DB Reader">
> 
>       <ShowOnDemand>true</ShowOnDemand>
> 
>       <Description>
> 
>        Reads data from a database whose data model is supported by an
> ObjectServer
> 
>        </Description>
> 
>       <Property>
> 
>         <Constant>true</Constant>
> 
>         <Name>DisplayName</Name>
> 
>         <Value>DB Readerr</Value>
> 
>       </Property>
> 
>       <Property>
> 
>         <Constant>true</Constant>
> 
>         <Name>Type</Name>
> 
>         <Value>ObjectServer Reader</Value>
> 
>       </Property>
> 
>       <Property>
> 
>         <Constant>true</Constant>
> 
>         <Name>Class</Name>
> 
>         <Value>com.lgc.im.dataio.db.objectserver.ReaderImpl</Value>
> 
>       </Property>
> 
>       <Property>
> 
>         <Constant>true</Constant>
> 
>         <Name>Category</Name>
> 
>         <Value>DataBase</Value>
> 
>       </Property>
> 
>       <Property>
> 
>         <Constant>true</Constant>
> 
>         <Name>Format</Name>
> 
>         <Value>ObjectServer</Value>
> 
>       </Property>
> 
>       <Property>
> 
>         <Constant>true</Constant>
> 
>         <Name>Resource Class</Name>
> 
>         <Value>com.lgc.im.dataio.db.objectserver.ResourceImpl</Value>
> 
>       </Property>
> 
> 
> 
>     </Component>
> 
>   </Components>
> 
> </ComponentRegistry>
> 
> 
> 
> 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> 
> <!-- edited with XMLSPY v5 rel. 2 U (http://www.xmlspy.com) by James
> L. Blunt (Landmark Graphics Corp.) -->
> 
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified" attributeFormDefault="unqualified">
> 
>   <xs:element name="ComponentRegistry">
> 
>     <xs:annotation>
> 
>       <xs:documentation>Comment describing your root
> element</xs:documentation>
> 
>     </xs:annotation>
> 
>     <xs:complexType>
> 
>       <xs:sequence>
> 
>         <xs:element name="Components">
> 
>           <xs:complexType>
> 
>             <xs:sequence minOccurs="0" maxOccurs="unbounded">
> 
>               <xs:element name="Component">
> 
>                 <xs:complexType>
> 
>                   <xs:sequence>
> 
>                     <xs:element name="ShowOnDemand"
> type="xs:boolean"/>
> 
>                     <xs:element name="Description" type="xs:string"/>
> 
>                     <xs:element name="Property"
> type="DisplayPropertyType"/>
> 
>                     <xs:element name="Property"
> type="TypePropertyType"/>
> 
>                     <xs:element name="Property"
> type="ClassPropertyType"/>
> 
>                     <xs:element name="Property"
> type="CategoryPropertyType"/>
> 
>                     <xs:element name="Property"
> type="FormatPropertyType"/>
> 
>                     <xs:element name="Property"
> type="ResourceClassPropertyType"/>
> 
>                   </xs:sequence>
> 
>                   <xs:attribute name="name" type="xs:string"
> use="required"/>
> 
>                 </xs:complexType>
> 
>               </xs:element>
> 
>             </xs:sequence>
> 
>           </xs:complexType>
> 
>         </xs:element>
> 
>       </xs:sequence>
> 
>     </xs:complexType>
> 
>   </xs:element>
> 
>   <xs:complexType name="PropertyType">
> 
>     <xs:sequence>
> 
>       <xs:element name="Constant" type="xs:boolean" minOccurs="0"/>
> 
>       <xs:element name="Name" type="xs:string"/>
> 
>       <xs:element name="Value" type="xs:string"/>
> 
>       <xs:element name="InVisible" type="xs:boolean" minOccurs="0"/>
> 
>     </xs:sequence>
> 
>   </xs:complexType>
> 
>   <xs:complexType name="DisplayPropertyType">
> 
>     <xs:complexContent>
> 
>       <xs:restriction base="PropertyType">
> 
>         <xs:sequence>
> 
>           <xs:element name="Constant" type="xs:boolean"
> minOccurs="0"/>
> 
>           <xs:element name="Name">
> 
>             <xs:simpleType>
> 
>               <xs:restriction base="xs:string">
> 
>                 <xs:enumeration value="DisplayName"/>
> 
>               </xs:restriction>
> 
>             </xs:simpleType>
> 
>           </xs:element>
> 
>           <xs:element name="Value" type="xs:string"/>
> 
>           <xs:element name="InVisible" type="xs:boolean"
> minOccurs="0"/>
> 
>         </xs:sequence>
> 
>       </xs:restriction>
> 
>     </xs:complexContent>
> 
>   </xs:complexType>
> 
>   <xs:complexType name="TypePropertyType">
> 
>     <xs:complexContent>
> 
>       <xs:restriction base="PropertyType">
> 
>         <xs:sequence>
> 
>           <xs:element name="Constant" type="xs:boolean"
> minOccurs="0"/>
> 
>           <xs:element name="Name">
> 
>             <xs:simpleType>
> 
>               <xs:restriction base="xs:string">
> 
>                 <xs:enumeration value="Type"/>
> 
>               </xs:restriction>
> 
>             </xs:simpleType>
> 
>           </xs:element>
> 
>           <xs:element name="Value" type="xs:string"/>
> 
>           <xs:element name="InVisible" type="xs:boolean"
> minOccurs="0"/>
> 
>         </xs:sequence>
> 
>       </xs:restriction>
> 
>     </xs:complexContent>
> 
>   </xs:complexType>
> 
>   <xs:complexType name="ClassPropertyType">
> 
>     <xs:complexContent>
> 
>       <xs:restriction base="PropertyType">
> 
>         <xs:sequence>
> 
>           <xs:element name="Constant" type="xs:boolean"
> minOccurs="0"/>
> 
>           <xs:element name="Name">
> 
>             <xs:simpleType>
> 
>               <xs:restriction base="xs:string">
> 
>                 <xs:enumeration value="Class"/>
> 
>               </xs:restriction>
> 
>             </xs:simpleType>
> 
>           </xs:element>
> 
>           <xs:element name="Value" type="xs:string"/>
> 
>           <xs:element name="InVisible" type="xs:boolean"
> minOccurs="0"/>
> 
>         </xs:sequence>
> 
>       </xs:restriction>
> 
>     </xs:complexContent>
> 
>   </xs:complexType>
> 
>   <xs:complexType name="CategoryPropertyType">
> 
>     <xs:complexContent>
> 
>       <xs:restriction base="PropertyType">
> 
>         <xs:sequence>
> 
>           <xs:element name="Constant" type="xs:boolean"
> minOccurs="0"/>
> 
>           <xs:element name="Name">
> 
>             <xs:simpleType>
> 
>               <xs:restriction base="xs:string">
> 
>                 <xs:enumeration value="Category"/>
> 
>               </xs:restriction>
> 
>             </xs:simpleType>
> 
>           </xs:element>
> 
>           <xs:element name="Value" type="xs:string"/>
> 
>           <xs:element name="InVisible" type="xs:boolean"
> minOccurs="0"/>
> 
>         </xs:sequence>
> 
>       </xs:restriction>
> 
>     </xs:complexContent>
> 
>   </xs:complexType>
> 
>   <xs:complexType name="FormatPropertyType">
> 
>     <xs:complexContent>
> 
>       <xs:restriction base="PropertyType">
> 
>         <xs:sequence>
> 
>           <xs:element name="Constant" type="xs:boolean"
> minOccurs="0"/>
> 
>           <xs:element name="Name">
> 
>             <xs:simpleType>
> 
>               <xs:restriction base="xs:string">
> 
>                 <xs:enumeration value="Format"/>
> 
>               </xs:restriction>
> 
>             </xs:simpleType>
> 
>           </xs:element>
> 
>           <xs:element name="Value" type="xs:string"/>
> 
>           <xs:element name="InVisible" type="xs:boolean"
> minOccurs="0"/>
> 
>         </xs:sequence>
> 
>       </xs:restriction>
> 
>     </xs:complexContent>
> 
>   </xs:complexType>
> 
>   <xs:complexType name="ResourceClassPropertyType">
> 
>     <xs:complexContent>
> 
>       <xs:restriction base="PropertyType">
> 
>         <xs:sequence>
> 
>           <xs:element name="Constant" type="xs:boolean"
> minOccurs="0"/>
> 
>           <xs:element name="Name">
> 
>             <xs:simpleType>
> 
>               <xs:restriction base="xs:string">
> 
>                 <xs:enumeration value="Resource Class"/>
> 
>               </xs:restriction>
> 
>             </xs:simpleType>
> 
>           </xs:element>
> 
>           <xs:element name="Value" type="xs:string"/>
> 
>           <xs:element name="InVisible" type="xs:boolean"
> minOccurs="0"/>
> 
>         </xs:sequence>
> 
>       </xs:restriction>
> 
>     </xs:complexContent>
> 
>   </xs:complexType>
> 
> </xs:schema>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Bill Riegel
> 
> LandMark Graphics
> 
> 713-839-3388
> 
> 
> 
>     ---------------------------------------------------------------
> -----------------------------------------------------------------
> 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://lists.xml.org/ob/adm.pl>
begin:vcard 
n:Chiusano;Joseph
tel;work:(703) 902-6923
x-mozilla-html:FALSE
url:www.bah.com
org:Booz | Allen | Hamilton;IT Digital Strategies Team
adr:;;8283 Greensboro Drive;McLean;VA;22012;
version:2.1
email;internet:chiusano_joseph@b...
title:Senior Consultant
fn:Joseph M. Chiusano
end:vcard

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.