Relative links in schemata

Ray Plante rplante at ncsa.uiuc.edu
Wed Jan 12 22:16:57 PST 2005


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




More information about the registry mailing list