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
Mark MaltbySubject: Invalid Schema
Author: Mark Maltby
Date: 08 Apr 2006 03:00 PM
Is the below valid? I would like to create the following in xml.

EG
<Scores>
<Score num="1">50<Score>
<Score num="2">45<Score>
<Score num="3">76<Score>
</Scores>

The schema for this is below. It is only possible to create this in Stylus Studio if you add 'type' to the element 'Score' manually. The WYSIWYG interface won't allow you to do this. Instead it removes the attribute so you can then enter a type.

Now for the strange part. If I validate this using C++ the schema is valid, but if I do the same but using visual basic 6 the schema produces an error when loaded. The error shown points to a type with an attribute complex type.

Am I missing some schema rules here. Can someone explain.

<xsd:element name="Scores" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="Score" maxOccurs="25" minOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element name="Score" type="xsd:long">
<xsd:complexType>
<xsd:attribute name="Position" type="xsd:long"/>
</xsd:complexType>
</xsd:element>

Postnext
Minollo I.Subject: Invalid Schema
Author: Minollo I.
Date: 08 Apr 2006 11:37 PM
That schema is wrong; you can't assign a type to Score and also define a local complexType for it. You need to change the definition of Score into:

<xsd:element name="Score">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:long">
<xsd:attribute name="Position" type="xsd:long"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>

Posttop
Mark MaltbySubject: Invalid Schema
Author: Mark Maltby
Date: 09 Apr 2006 04:36 AM
Thanks, that worked.

 
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.