Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] user-defined types in something other than Schema?

From: "Michael Kay" <mike@------------>
To:
Date: 1/4/2005 6:07:00 PM
> Is it possible to declare user-defined types for 
> XSLT 2.0 with something other than XML Schema?
> 
> As I read http://www.w3.org/TR/xslt20/ , the
> xsl:import-schema statement supports only XML Schema. 

XML Schema defines an abstract model of types, as well as a concrete syntax.
XSLT is dependent on the abstract model, but not on the concrete syntax. The
specification of xsl:import-schema is essentially that you supply a
namespace and a location hint and the system returns a set of type
definitions in that namespace. Implementations are allowed to innovate in
how that works in detail.

Saxon, for example, is starting to map Java classes onto the type system so
that any Java class can be regarded as an XSLT/XPath type. The detail of
this isn't well fleshed out yet, but it can be done.
> 
> 
> For instance, one can't provide an adapter for
> xsl:import-schema statement that implements 
> non-Schema typing such as ooRelaxNG or DTLL.

Yes, I think you can - provided the implementor gives you the right hooks,
and provided you can express the relevant types in terms of the XML Schema
model (e.g. you have to say whether they are simple types or complex types,
what their lexical space and value space is, and so on).
> 
> Would it be conceivable for a DITA implementer 
> to create a DITA adapter for xsl:import-schema 
> that could populate the type annotation based 
> on the DITA class attribute?  Or, could a DITA
> implementer provide templates that add type annotation
> to the tree and declare the type hierarchy prior
> to firing templates that match the tree based
> on the type?

In principle the language is designed to have the architectural flexibility
to allow this. Time will tell whether implementations choose to exploit all
this freedom.
> 
> As a workaround for non-Schema type definitions,
> might one generate a Schema in which each element 
> has the correct type and each type has the correct 
> base type but each type can contain any element or
> attribute?

Certainly one way of coping with any product limitations is to translate the
types you want to use into XML Schema notation.

In Saxon you could in principle construct the schema object model
programmatically. In practice, I don't think I would recommend it, because
the processor doesn't (yet) provide any way to check the consistency of the
model unless it's being built from source schema documents.

If this is a direction you want to explore, however, get in touch off-list.

Michael Kay
http://www.saxonica.com/


transparent
Print
Mail
Like It
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.

.
.

transparent

transparent