OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] schema validation question

[ Lists Home | Date Index | Thread Index ]

Hi Joe,

You should probably ask questions about XML Schema on
xmlschema-dev@w3.org 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/





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS