Next in thread →
Next in month →
Re: [xml-dev] schema validation question
Hi Joe, You should probably ask questions about XML Schema on 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/
Next in thread →
Next in month →