tags:

views:

140

answers:

2

I have an XML schema file which references a urn based location. Is there some way to resolve this into a url, or some way to actually read the file it refers to.

<xs:include schemaLocation="urn:oasis:names:tc:dita:xsd:tblDeclGrp.xsd:1.1"/>
A: 

The schemaLocation is in this case the location. If you have a file named exactly like this in the same directory it should be resolved. It is even include the urn: part so the complete string. It is just convienient to name the file after the schema namespace. Confusing at first I must admit.

Btw. the urn is not a location it is just an URI. The attribute of the xs:include schemaLocation that refers to a location but the attribute type is anyURI which includes urn schema

Norbert Hartl
+1  A: 

...maybe look at RFC3121 A URN Namespace for OASIS?

edit: I can never remember URIs and URNs, but my understanding is they're just namespaces, they don't actually have to correspond to some real location on the network where a file is stored. They just divide up control over portions of the namespace so urn:oasis is under control of OASIS. You're not supposed to invent any URIs / URNs that are within that section of the hierarchy unless you have control over it.

edit 2: A little google searching found a file in oasis-open.org called tblDeclGrp.xsd and some commentary on it and other schemas.

Jason S
I had a read through the RFC, and a few other sources. As a unique identifier this seems useful, but its not much help to a parser trying to resolve the actual schema, as each provider may have a different format.
Colin