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

Re: XML won't validate against schema

  • From: Martin Gudgin <marting@d...>
  • To: majormit@W..., Danny Ayers <danny@p...>,Xml-Dev <xml-dev@l...>
  • Date: Mon, 16 Apr 2001 18:14:51 +0100

validate against schema
A few things spring to mind;

1.    XMLSpy doesn't like minOccurs='0' on the xsd:all element ( validate
the schema doc to get this info ) ( 0 is a valid value according to the
latest spec BTW )

2.    Valid values of maxOccurs on an xsd:all are either 0 or 1. unbounded
is not allowed ( line 495 )

3.    All that being said, it still doesn't work although changing the
xsd:all elements to xsd:sequence fixes the immediate problem ( and would
allow values other than 1 or 0 for min/maxOccurs ). I suspect XMLSpy has a
problem with xsd:all here.

You will also need to reorder subclass and class on lines 47 and 48 of
instance doc because of the change to sequence. Also change the date value
on line 64 and 69 to read 2000-01-01 ( YYYY-MM-DD ), provide a time value on
line 65 and 70 and change the value of the duration element on line 80 to
PT20H3M0S ( assuming you wanted a duration of 20 hours and 3 minutes ). In
addition the base type for the anonymous simpleType inside the element
declaration of discount_type should ( I think ) be xsd:string rather that
xsd:byte.

Fixed schema is at[1]. Fixed instance is at[2]

Regards

Martin Gudgin

[1] http://marting.develop.com/xsd/tso_market.fixed.xsd
[2] http://marting.develop.com/xsd/tso_sample.fixed.xml



----- Original Message -----
From: "Tim Greiner" <majormit@W...>
To: "Danny Ayers" <danny@p...>; "Xml-Dev" <xml-dev@l...>
Sent: Monday, April 16, 2001 5:46 PM
Subject: XML won't validate against schema


> The .xsd and .xml files are attached. XMLSpy says the xml file is not
valid
> because of mandatory elements 'name' and 'phone' in 'contact'. however
those
> elements are there and have data in them.
>
> Thanks
>
> Tim
>
> Can you please post the schema & doc. Unless it's an instantly
recognisable
> XMLSpy bug, there's not a lot to go on here.
>
> ---
> Danny Ayers
> http://www.isacat.net
>
> <- -----Original Message-----
> <- From: Tim Greiner [mailto:majormit@W...]
> <- Sent: 16 April 2001 20:37
> <- To: Xml-Dev
> <- Subject: XML won't validate against schema
> <-
> <-
> <- Hi all...newbie here trying to validate an xml doc against a
> <- schema I built
> <- with XMLSpy.  The schema contains a required element with some
> <- optional and
> <- required children. However, the XMLSpy validator says the file
> <- is not valid
> <- (Mandatory elements expected in 'contact' after 'phone': name, phone)
> <-
> <- 'contact' is the reqd element and 'phone' and 'name' are the
> <- reqd children
> <- of contact. I have entered data in for name and phone but am
> <- still getting
> <- the not valid msg...anyone seen this?
> <-
> <- Thanks
> <-
> <- Tim
> <-
> <-
> <- ------------------------------------------------------------------
> <- The xml-dev list is sponsored by XML.org, an initiative of OASIS
> <- <http://www.oasis-open.org>
> <-
> <- The list archives are at http://lists.xml.org/archives/xml-dev/
> <-
> <- To unsubscribe from this elist send a message with the single word
> <- "unsubscribe" in the body to: xml-dev-request@l...
> <-
>
>


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.