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"/>
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"/>
...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.
This question is not a good place for explanations about "URN resolution"... We can imagine a translation (by an automatic translator) from this oasis URN to a schemaLocation filename or a URL, but it is a little bit exotic application for URNs.
See the usual semantic and values for schemaLocation at http://www.w3.org/TR/xmlschema-1/#schema-repr
#URN resolution
You can see real-life examples of URNs at Wikipedia and the complete semantic of the term "resolve a URN" at RFC-2169 and RFC-2483. According these RFCs what you need is a local software or a URL of a "URN resolver" software (a webservice) that do N2L: given a URN, return a URL.
In 2002 the URN resolution mechanism received more attention, and two new RTFs, RFC-3404 and RFC-3405, solved a latent problem of URNs,
If URN resolution is collapsed into generic URI resolution, URNs may suffer by the lack of adoption of URI resolution.
The solution is to allow for shortcutting for URN resolution. (...) generic URI resolution starts by inserting rules for known URI schemes into the 'uri.arpa.' registry. For the 'URN:' URI scheme, one of the rules found in 'uri.arpa.' would be for the 'urn' URI scheme. This rule would simply delegate to the 'urn.arpa.' zone for additional NAPTRs based on the URN namespace. Essentially, the URI Resolution Rewrite Rule for 'URN:' is the URN Resolution Application's First Well Known Rule.
Some resolution problems persist: URNs like urn:doi
or urn:lex:br
have a so used and stable resolution mechanism (at dx.doi.org and lexml.gov.br/urn respectively), but is not registered at IANA's assignments/urn-namespaces; a not used, not stable and not controlled URN like urn:oasis:names:tc:dita
have urn:oasis
registered at IANA.
urn:oasis:names:tc:entity:xmlns:xml:catalog
) have non-obvious resolution algorithm. The simplest algorithm for XML is the concatenation a url_base
attribute with URN. –
Styrene https://doi.org/{urn}
. You can test with full doi.org/urn:doi:10.1000/182 or simplified URN by doi.org/10.1000/182 using theDOI
fragment of urn:doi:{theDOI}
. Test with a scientific article's URN, urn:doi:10.1038/ncomms7368
. Other example: https://www.lexml.gov.br/urn/{urn_lex}
. –
Styrene ...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.
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
© 2022 - 2024 — McMap. All rights reserved.