Relative links in schemata

Matthew J. Graham mjg at cacr.caltech.edu
Wed Jan 12 23:11:32 PST 2005


Hi Arnold,

schemaLocation is a required attribute for the include element in the  
W3C XML Schema specification so it cannot be omitted; it is, however,  
arbitrary for the import element with Ray's recommendation being to  
omit it if you want the standard version of the schema.
Obviously if you are using amended versions of the schemas, such as I  
do for my XForms  - I have editted more documentation into them - then  
you should probably specify the schemaLocation on the import element.

	Cheers,

	Matthew

On Jan 12, 2005, at 10:41 PM, Arnold Rots wrote:

> Ray,
>
> Now I'm confused (again).
> I thought your recommendation, albeit for import, was to omit the
> SchemaLocation, so it would default to the URI of the namespace.
> Which says that the intent is to always get the schema from the
> network.  Did we change our mind on this?
>
> Cheers,
>
>   - Arnold
>
> Ray Plante wrote:
>> Hey Guy,
>>
>> On Wed, 12 Jan 2005, Guy Rixon wrote:
>>> <xs:include schemaLocation="VODataServiceCoverage-v0.5.xsd"/>
>>>
>>> The intended semantics of the URI in this code are clear: "get the  
>>> subsidiary
>>> file from the same place that you got the main file". However, the  
>>> XSD
>>> standard (W3C XML Schema recommendation) doesn't specify these  
>>> semantics,
>>
>> Actually, I think it does, albeit indirectly.  The value of the
>> schemaLocation attribute is defined to be an "anyURI" (Part 1;  
>> 4.2.1), and
>> "anyURI" is allowed to be absolute or relative in accordance with the  
>> URI
>> definition in IETF RFC 2396 (Part 2; 3.2.17), which in turn describes  
>> a
>> relative URI as the difference from the URI of the current context.
>>
>>> at least one of my XML tools (oXygen 5.0) seems not to find the  
>>> susidiary
>>> file.
>>>
>>> Is it possible to change the URL to be absolute or to actually  
>>> include the
>>> child schema in the parent at source?
>>
>> I'm open to the idea, but my suspision is that this will cause more
>> problems than it fixes.  The relative URL was chosen because it works  
>> with
>> many parsers regardless of whether you are drawing the files from the
>> network or local disk.  In particular, you would have to change the  
>> schema
>> if you were not conncected with the network.
>>
>> cheers,
>> Ray
>>
>>
> ----------------------------------------------------------------------- 
> ---
> Arnold H. Rots                                Chandra X-ray Science  
> Center
> Smithsonian Astrophysical Observatory                tel:  +1 617 496  
> 7701
> 60 Garden Street, MS 67                              fax:  +1 617 495  
> 7356
> Cambridge, MA 02138                              
> arots at head.cfa.harvard.edu
> USA                                      
> http://hea-www.harvard.edu/~arots/
> ----------------------------------------------------------------------- 
> ---



More information about the registry mailing list