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

RE: minOccurs maxOccurs doesnt seem to be working correctly in

  • To: Michael Kay <mike@s...>, 'Paul Spencer' <xml-dev-list@b...>, xml-dev@l...
  • Subject: RE: minOccurs maxOccurs doesnt seem to be working correctly in my schema
  • From: Marielou <marielou_h@y...>
  • Date: Wed, 14 Jun 2006 18:28:32 +0100 (BST)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.uk; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=286QMqEvk0//vzvnapTLcs44Bho8ju3i6luO7zkL1h9yN708BxM0dQKv4WFT2CEIst4YnMfNB6XtSrL0sooBtQ8QIP5J38xreDDGVra/eNUS32hdmtKIZJD4idtqQW5X+w+VdosKNhHKZjBDi0x/4XfDpjkqsoZzvFC8Cmp9yY4= ;
  • In-reply-to: <016201c68fd1$f9157e30$6401a8c0@turtle>

maxoccurs not working schema
Yes I have just tested that if element <B> appears in
my XML file, I need to have element <C> as a child of
<B> for the file to validate. However, I am finding
that my schema is accepting <C> without <B> and so
that is what has been confusing me! Because I see that
on testing, my schema is seemingly accepting any
elements which are not defined in the schema and any
number of child elements defined in the schema despite
them having a restriction on the occurrences. For
example, i can type a brand new element in the XML <D>
not defining it in the schema, and this validates
also. And on testing, I also find I can take out all
occurrences of a child element of <A> from the XML and
validate ok, even if that element had maxOccurs="1" in
<A>. Though the type restrictions I put on elements
which do exist in my schema seem to be being checked
properly. 

Marie Louise


--- Michael Kay <mike@s...> wrote:

>  
> > My XML file has format:
> > 
> > <parentA>
> >  		<C>0</C>
> >  		<C>1</C>
> >  		<C>2</C>
> >  		<C>3</C>
> > 		<C>4</C>
> >  		<C>5</C>
> >  		<C>6</C>
> >  		<C>7</C>
> > </parentA>
> > 
> > <B> is just an element ref I put in the <all> tag
> in <A> to 
> > get around the fact that <A> has no sequence but
> elements 
> > which need to occur more than once. <B> describes
> the 
> > occurrences of <C> to be more than 1, in my schema
> 
> > maxOccurs="7" but <B> does not occur in my XML
> document
> 
> No, B is an element declaration. The content model
> of parentA allows B
> elements and nothing else. Your schema doesn't allow
> C elements to appear as
> children of a parentA, only as grandchildren.
> 
> Michael Kay
> http://www.saxonica.com/
> 
> 


Send instant messages to your online friends http://uk.messenger.yahoo.com 

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.