XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Adriaan VanderendeSubject: error in xsd
Author: Adriaan Vanderende
Date: 12 Sep 2002 10:17 AM
Hi,

I get errors on attached xsd. As in other xml editors is does not give me an error.

Validating Untitled1.xsd...
Untitled1.xsd:26,42: The type 'xsd:string' is a simple type. It cannot be used in a derivation by RESTRICTION for a complexType
Untitled1.xsd:36,42: The type 'xsd:string' is a simple type. It cannot be used in a derivation by RESTRICTION for a complexType
Untitled1.xsd:13,45: The type 'xsd:string' is a simple type. It cannot be used in a derivation by RESTRICTION for a complexType


Documenterroron xsd.xsd

Postnext
(Deleted User) Subject: Re: error in xsd
Author: (Deleted User)
Date: 12 Sep 2002 10:45 AM
At 10.32 12/09/2002 -0400, you wrote:
>From: "Adriaan Vanderende"
>
>Hi,
>
>I get errors on attached xsd. As in other xml editors is does not give me
>an error.
>
>Validating Untitled1.xsd...
>Untitled1.xsd:26,42: The type 'xsd:string' is a simple type. It cannot be
>used in a derivation by RESTRICTION for a complexType
>Untitled1.xsd:36,42: The type 'xsd:string' is a simple type. It cannot be
>used in a derivation by RESTRICTION for a complexType
>Untitled1.xsd:13,45: The type 'xsd:string' is a simple type. It cannot be
>used in a derivation by RESTRICTION for a complexType

Adrian, the schema makes use of this definition (replace { with < and }
with >):

{xsd:element name = "f1"}
{xsd:complexType}
{xsd:simpleContent}
{xsd:restriction base = "xsd:string"}
{xsd:length value = "6"/}
{xsd:attribute name = "attrib2"
type = "xsd:string"/}
{/xsd:restriction}
{/xsd:simpleContent}
{/xsd:complexType}
{/xsd:element}

and this, according to the section 2.2.1.3 (Complex Type Definition) is
illegal.

"Each complex type definition is either
- a restriction of a complex base type definition
or
- an extension of a simple or complex base type definition
or
- a restriction of the ur-type definition.
"

The correct schema would be

{xsd:simpleType name="sizcharstring"}
{xsd:restriction base="xsd:string"}
{xsd:length value="6"/}
{/xsd:restriction}
{/xsd:simpleType}
{xsd:element name = "f1"}
{xsd:complexType}
{xsd:simpleContent}
{xsd:extension base = "sizcharstring"}
{xsd:attribute name = "attrib2"
type = "xsd:string"/}
{/xsd:extension}
{/xsd:simpleContent}
{/xsd:complexType}
{/xsd:element}

where you first define a new simple type derived by restriction from
xsd:string, then you extend it to add the attribute to define the complex
type for f1.

Hope this helps,
Alberto


Posttop
Adriaan VanderendeSubject: error in xsd
Author: Adriaan Vanderende
Date: 13 Sep 2002 05:41 AM
thanx , I have it working now

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

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