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

Re: schema: error validation depending on global orlocal eleme


schema error
On Thu, 2004-03-18 at 13:14, Pedro Salazar wrote:
> Greetings,
> 
> I'm getting a validation error depending of the declaration of my
> elements are local or global.
> 
> For instance, this sample xml:...
> is reporting this error:
> 
> error:cvc-complex-type.2.4.a: Invalid content starting with element 'a'.
> The content must match '((("":a)|("":b)))
> 
> The schema is:...
> 
> If I replace my local elements declarations, a and b, and use the
> declaration by ref (using the commented code) it works fine.
> 
> Why is that happens?

You don't show enough of the schema, or of the instance,
for me to be sure, but if I had to guess on the basis of
the information you provide, I'd guess

  - your schema has the default setting of 
    elementFormDefault='unqualified'
  - in the instance, your local elements are unprefixed
  - in the instance, your local elements are
    inheriting a default namespace from a surrounding
    element
  - therefore, in the instance your local elements are
    qualified, but their declarations are unqualified

I'd change the elementFormDefault on the schema element
to 'qualified' if I were you.  (Other people, of course,
swear that you should never have qualified locals, only
unqualified.  I think they're crazy, but some of them are
very smart, so maybe they're right and I'm wrong on the
Right Way to Write Schemas.  The fact that we couldn't
agree on a single Right Way, of course, is why the
elementFormDefault attribute exists in the first place.
No one liked the idea -- but everyone thought it was
better than having the decision go The Wrong Way.)

Just my two cents,

-Michael Sperberg-McQueen
 W3C



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.