[
Lists Home |
Date Index |
Thread Index
]
Hi Tom,
>> > Do you think that it would make sense for the *only* validation to be
>> > done on a document to be validation dictated by the stylesheet?
>>
>> yes.
>
> Me, too, but with the proviso that there be some means to optionally
> tell the processor to use the schema reference in the source
> document. Otherwise, if we wanted to use the schema, the stylesheet
> would have to be told the URI of the schema, which might be
> impossible - we wouldn't usually know it.
I think that the only time we wouldn't know the location of the schema
is if we were writing a generic stylesheet -- one that didn't care
about the structure of the source document. I agree that for these
situation you need some way of using the schema associated with the
source document.
David's suggestion of identifying it through the
xsi:(noNamespaceS|s)chemaLocation attribute is a good one, I'd
guess. It has the disadvantage that the application has to start
parsing the document before it can work out where to look for the
schema against which to validate it, but that's a common problem with
the xsi:(noNamespaceS|s)chemaLocation attribute anyway.
The advantage of not hardwiring *how* the schema is retrieved is that
is enables you to use other heuristics to locate the schema. A
stylesheet could have its own mapping between namespace URIs, or the
names of document elements, and physical schemas against which the
document should be assessed. I think that a solution should support
those possibilities. In addition, it opens the way for other
mechanisms for schema location (e.g. PIs to point to RELAX NG schemas)
to be used in other situations.
> It would also be useful to ask the processor to use the
> document-supplied schema with a fallback to no-schema-processing if
> the specifiec schema should not be available. I'm not too sure about
> this one, though, because what if part of the stylesheet referred to
> specific PSVI types?
I think that a well-designed stylesheet should reference a schema that
contains the type definitions for any types that it uses internally.
Otherwise it's like using a named template and expecting the source
document to provide its definition; not a wise course of action. In
fact, given that (in some applications) you might have a compile-once,
use-multiple-times architecture, it would be fatal to refer to a type
for which you don't have a definition within a referenced schema.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
|