W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2007

issue with restrictions

From: Guillaume Lebleu <gl@brixlogic.com>
Date: Tue, 06 Mar 2007 14:38:35 -0500
Message-ID: <45EDC33B.3070502@brixlogic.com>
To: xmlschema-dev@w3.org


I'm new to this list. I'm having a XSD development issue that relates to 
restrictions and I hope this is the right place to ask.

My context is one where developers can create new messages but they must 
follow some pre-defined patterns. For instance, I want all my search 
request messages to contain 0 or more search criterias that they can 
pick from a list of concrete predefined criterias.

What I am trying to do is use XSD to enforce these patterns. A sample 
XSD is below. When I validate the XSD, I get the error that 
SearchRequestByDate is not a valid restriction of SearchRequest.

Thank you,


<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:complexType name="SearchRequest" abstract="true">
            <xs:element ref="SelectionCriteria" minOccurs="0" 

    <xs:element name="SelectionCriteria" abstract="true"/>
    <xs:element name="StartDate" type="xs:string" 
    <xs:element name="EndDate" type="xs:string" 
    <xs:complexType name="SearchRequestByDate">
            <xs:restriction base="SearchRequest">
                <xs:element ref="StartDate"/>
                <xs:element ref="EndDate" minOccurs="0"/>
Received on Tuesday, 6 March 2007 20:36:52 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:41 UTC