Re: [xsl] Request help in understanding: node instance of schema-element(node)

Subject: Re: [xsl] Request help in understanding: node instance of schema-element(node)
From: Eliot Kimber <ekimber@xxxxxxxxxxxx>
Date: Mon, 28 Jan 2008 12:14:59 -0600
Wendell Piez wrote:
At 05:28 AM 1/27/2008, Mike wrote:
To be honest, even though Saxon does use xsi:schemaLocation for the limited
purpose of locating a schema once validation has been requested, I don't
think it's a good idea to use it. If you are validating a document then
that's probably because you don't trust it, and if you don't trust it, then
why should you trust its schemaLocation attribute?

I agree with the conclusion here. The reasoning, however, does open a deeper set of issues.

In my experience, schemas (of whatever variety) have been used for two purposes, which have historically been joined at the hip, but which are actually quite distinct.

One is "validation", which is to say, determine whether a document or parts of a document conform to an expected or required type. ("Schema as gauge.")

The other is for type annotation or even for binding of XML data (which natively takes the form of sequences of characters) to data types. ("Schema as jig.")

I think there's an important third reason, schema-driven editing, where the schema is used by an editing tool to assist with creating XML documents. In that case schemaLocation is a convenience for binding a particular document to the schema to use to guide and constrain authoring.

Also, there is the important case of documents that have elements not in a namespace--in that case there is no better solution than schemaLocation for binding elements to their governing schemas. But I also agree that in that case schemaLocation is no better than a DOCTYPE declaration since you can't even check to see if the schema referenced matches the schema you have configured for use with a given namespace.



Eliot Kimber
Senior Solutions Architect
"Bringing Strategy, Content, and Technology Together"
Main: 610.631.6770

Current Thread