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

Re: Restriction error

From: Dave Pawson <dave.pawson@gmail.com>
Date: Wed, 20 Mar 2013 14:06:33 +0000
Message-ID: <CAEncD4f5ZV=GgmhrDGcs_Tc2CGzY=MF+ZGn7X5j=7k4PqM083w@mail.gmail.com>
To: XMLSchema-dev <xmlschema-dev@w3.org>
Note I'm the real newbie here Mike.

On 20 March 2013 13:53, Michael Kay <mike@saxonica.com> wrote:
> A complex-type-with-simple-content is generally defined by extension: think
> of it as first defining the simple content of the element, then extending it
> to allow attributes.
> You can define a c-t-with-s-c as a restriction of another c-t-with-s-c, but
> that doesn't seem to be what you are doing here; the suggestion from the
> error message is that dc:SimpleLiteral is a simple type, not a c-t-with-s-c.
> Difficult to correct this without knowing what you are trying to achieve.
> Why are you saying xml:lang is prohibited? Does your new type allow any
> attributes, and if so, which? What is the definition of dc:SimpleLiteral?

I'm trying to understand this schema, then reduce it.


<xs:complexType name="SimpleLiteral" mixed="true">
			<xs:documentation xml:lang="en">
            This is the default type for all of the DC elements.
            It permits text content only with optional
            xml:lang attribute.
            Text is allowed because mixed="true", but sub-elements
            are disallowed because minOccurs="0" and maxOccurs="0"
            are on the xs:any tag.

    	    This complexType allows for restriction or extension permitting
            child elements.
		<xs:complexContent mixed="true">
			<xs:restriction base="xs:anyType">
					<xs:any processContents="lax" minOccurs="0" maxOccurs="0"/>
				<xs:attribute ref="xml:lang" use="optional"/>

Is that any help?


Dave Pawson
Docbook FAQ.
Received on Wednesday, 20 March 2013 14:07:19 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:21 UTC