RE: referencing a schema fails

On Tue, 2003-08-05 at 14:34, John Haber wrote:
> >>Could you repost the instance and schema, as they are now?
> 
> Sure, Paul, and my thanks.

> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://www.w3schools.com" xmlns="http://www.w3schools.com"
> elementFormDefault="qualified">
> <xsd:element name="reviews">
>   <xsd:complexType>
>     <xsd:sequence maxOccurs="unbounded">
> 	  <xsd:element ref="review" />
> 	</xsd:sequence>
>   </xsd:complexType>
> </xsd:element>
> <xsd:element name="review">
>   <xsd:complexType>
>     <xsd:sequence>
> 	  <xsd:element ref="blurb" />
> 	  <xsd:element ref="exhibition" />
> 	  <xsd:element ref="essay" />
> 	  <xsd:element ref="images" />
> 
> And here's how the first test xml file begins, stopping my cut-and-paste at
> around the same point to save you reading:
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <reviews xmlns="http://www.w3schools.com"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="artml.xsd">

Make this:

  xsi:schemaLocation="http://www.w3schools.com artml.xsd"

This gives the parser a hint as to where to find a schema (artml.xsd)
for the namespace http://www.w3schools.com.  

schemaLocation requires an even number of space separate values, a list
of (namespaces, schemalocation) pairs.  

If you didn't specify a targetNamespace in your schema, you'd be able to
use noNamespaceSchemaLocation with a single value - the schema location.

Paul
-- 
Paul Warren, Client Services           DecisionSoft Limited
+44-1865-203192                        http://www.decisionsoft.com

Received on Tuesday, 5 August 2003 09:44:02 UTC