Mapping namespace URIs to schemas via resolveURI is perfectly acceptable,
especially if there is no schemaLocation value (or "respect schema
locations" has been turned off).

The schema design has always left it flexible how a processor maps documents
to schemas and mapping namespaces to schema documents by some
implementation-specific means was always intended as a primary use case.

The value of @schemaLocation is that it makes it explicit what schema the
document expects to be governed by. On the other hand, if the
@schemaLocation value is a URN, then you still have to go through some sort
of mapping to resolve it, and if that URN will be invariant for a given
governed namespace, then it's no better than simply mapping on the namespace
in your processing environment. Likewise, you may have a need to have some
agent other than the document decide which schema to use, e.g., a content
management system that knows the business rules for document processing and
validation.

In many environments there will be multiple schemas that govern a single
namespace under different circumstances, whether its different versions in
time, variants for different uses (authoring vs. archive vs. interchange) or
whatever. So in general, better to assume there will be at least one level
of indirection between the document and the schema that should govern it for
any given processing of that document.

Cheers,

Eliot

On 10/17/11 11:22 AM, "Chris Simmons" <[email protected]> wrote:

>  I think you probably could use catalogs.  If you pass a namespace to
> XMLCatalogResolver then it is passed into the catalog using resolveURI so you
> I think that you should be able to use rewriteURI entries to achieve what you
> want.
>  
>  Whether this makes sense is another matter.  On my reading of the spec:-
>  
>  http://www.oasis-open.org/committees/entity/spec-2001-08-06.html#s.uri.res
>  
>  I'd expect the URI resolution entries to be used to process URI references -
> i.e. physical locations of documents like XSLT document locations or, for XML
> schemas, the schemaLocation attribute.  Rewriting URI prefixes doesn't make
> much sense for namespaces.  This is useful for rewriting a bunch of URI
> references for a web server to a local copy by matching prefixes.
>  
>  I'd be interested in hearing from anyone involved in the original spec for
> catalogs as to whether rewriteURI was intended for namespace URI's or not.  I
> suspect it wasn't considered at the time and hence there's no consensus.
>  
>  So you may find it less diseased to continue to use namespaces as public
> identifiers but write your own entity resolver.
>  
>  
>  Chris Simmons.
>  
>  

-- 
Eliot Kimber
Senior Solutions Architect
"Bringing Strategy, Content, and Technology Together"
Main: 512.554.9368
www.reallysi.com
www.rsuitecms.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to