W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2002

Re: xerces-j validation issues

From: Eddie Robertsson <erobertsson@allette.com.au>
Date: Mon, 09 Sep 2002 11:07:27 +1000
Message-ID: <3D7BF44F.5040408@allette.com.au>
To: Jon Wise <jwise@glos.ac.uk>
CC: xmlschema-dev@w3.org

Hi Jon,

>I have a similar problem. When trying to use .setProperty("
>......external-schemaLocation", ... ) there is a run-time error from the
>parser that I should supply an even numbers of URIs. Does anyone have an
>working example of code to show how it should be done. I am using
>xalan-j_2_4_0 which includes Xerces-Java 2.1.0.
>
When you use the external-schemaLocation property you have to specify 
both a namespace-uri and the url location of your schema. This is why 
the values must come in pairs and hence be of an even number. Example:

If you have schema with the target namespace "www.test.com" and the 
actual schema document is located at "www.test.com/schema.xsd" then your 
external-schemaLocation property should be set as follows:

setProperty("......external-schemaLocation", "www.test.com 
www.test.com/schema.xsd")

if you have more namespaces and locations then they can also be set in 
the same property:

setProperty("......external-schemaLocation", "ns1 loc1 ns2 loc2 ns3 loc3")

but the values must always come in pairs separated by whitespace. The 
property in Xerces works the same as the schemaLocation attribute in W3C 
XML Schema [1].

Cheers,
/Eddie

[1] http://www.w3.org/TR/xmlschema-1/#xsi_schemaLocation

>
>Jon Wise
>
>
>  
>
Received on Sunday, 8 September 2002 21:07:36 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:34 GMT