Just a guess, but I think the working model the spec-writers had in mind was
that if s1 imported s2 and s2 imported s3, that s1 would specify the
location of s2 (in the import element) and s2 would specify the location of
s3 (similarly).  In this case, the relative directory choices that actually
work make sense.  It also makes it easy to use s2 and s3 without s1.  That
is, you might specify an xsi:schemaLocation for s1, but allow the others to
be determined through the location attribute of the import elements, which
are interpreted relative to the current context in each case.

Jeff
----- Original Message ----- 
From: "Webb Roberts" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, June 23, 2003 10:23 AM
Subject: Re: Xerces validation / xsi:schemaLocation problem


> It seems that relative URLs specified in xsi:schemaLocation fields
> must be specified relative to the schemas in which they are imported.
> I suppose that there is some logic to it, but I have to call exception
> to it being rather obscure and inconsistent.
>
> Follow this example: An instance needs to specify three schemas.  The
> first imports the second and the third, and the second imports the
> third.  The schemaLocation value that I would expect to work, which
> shows the directory structure relative to the xml file is:
>
>      xsi:schemaLocation='http://something.com/schema1 s1d/schema1.xsd
>                          http://something.com/schema2 s2d/d/schema2.xsd
>                          http://something.com/schema3 s3d/d/d/schema3.xsd'
>
> However, since schema1 is importing schema2 and schema3, the
> schemaLocation value should be relative to the location of schema1.xsd:
>
>      xsi:schemaLocation='http://something.com/schema1 s1d/schema1.xsd
>                          http://something.com/schema2 ../s2d/d/schema2.xsd
>                          http://something.com/schema3
../s3d/d/d/schema3.xsd'
>
> However, since schema 1 imports schema2 before it imports schema3, and
> schema2 imports schema3, the specification for schema3 must be
> relative to schema2, not to schema3, so the schemaLocation value must
> be:
>
>      xsi:schemaLocation='http://something.com/schema1 s1d/schema1.xsd
>                          http://something.com/schema2 ../s2d/d/schema2.xsd
>                          http://something.com/schema3
> ../../s3d/d/d/schema3.xsd'


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to