Altova Mailing List Archives


Re: [xml-dev] XSLT 2.0 and XSL(-FO) 2.0

From: Jeni Tennison <jeni@------------.--->
To: "Thomas B. Passin" <tpassin@-------.--->
Date: 5/14/2002 1:21:00 PM
Hi Tom,

>> 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.
>
> Here's the situation I was thinking of. You have worked with another
> party who sends you documents according to a schema, but once the
> process is working the schema location isn't included anymore to
> prevent validation of every instance, which you have learned takes
> too long, or because the schema isn't always available (sometimes
> you work off-line and can't connect to the schema's location), but
> you still need to run transformations for some good reason. You have
> confidence that the documents are valid.
>
> This isn't uncommon today with DTDs, and I suppose it will happen
> with X-xxx 2.0 when schemas come into play. With DTDs, you have the
> problem of defaulted and fixed attributes being missing, but they
> are often (usually?) not used. With XML schemas, you hve the problem
> that if the schema is missing, the types are missing too.

Yes, absolutely. In XSLT 1.0, to deal with the first case (of
defaulted and fixed attributes), we make sure that the default
behaviour is the same whether the attribute is absent or present with
the default value. To deal with the missing types, we use keys and
normalize-space().

What I *hope* is that XSLT 2.0 will give you two options.

First, that you could point to the schema from the stylesheet, so that
you can guarantee that the schema document is available (you always
keep all the modules of your stylesheet application together) and that
it's the right one.

Second, that you could do the same kind of thing as is available in
XSLT 1.0 -- that it's possible to write around a lacking schema, so
that you can manipulate the values of attributes as if they were dates
even if you don't have a schema to tell you that they're dates
automatically.

You seemed to be saying before that you wanted some way to make the
schema referenced by the source document provide the types, but your
example demonstrates why that's a bad idea.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.