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

Re: schema validation question


xs elementformdefault
Hi Joe,

You should probably ask questions about XML Schema on
xmlschema-dev@w... rather than here.

> When I run the validator on the instance doc I receive errors that
> tell me all the element types, with the exception of the global
> element "Facts", must be declared.

Probably your instance document uses a default namespace declaration,
or all the elements in it have prefixes, such that all the elements in
the instance document are in your http://localhost:8080/xmlp/xs
namespace.

By default, when you declare an element locally (i.e. use <xs:element
name="..." /> within a complex type), it is "unqualified", which means
that it's declared to be in no namespace. To tell the XML Schema
validator that all the locally declared elements are in the target
namespace, you should set the "elementFormDefault" attribute on the
xs:schema element to "qualified" (its default is "unqualified"):

<schema xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:fac="http://localhost:8080/xmlp/xs"
        targetNamespace="http://localhost:8080/xmlp/xs"
        elementFormDefault="qualified">
...
</schema>

or you could go through your schema and add a 'form' attribute with
the value 'qualified' to every local element declaration if you
prefer.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.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.