xsl-list
[Top] [All Lists]

RE: Static type-checker

2005-11-17 06:22:04

  Mmh, yes.  But I want to check for static errors regarding *types*,
in all the XSLT script (not only in the template rules matching
schema-element()), in function of the schema.  Because net.sf.saxon is
not schema-aware, I presume net.sf.saxon.Compile does not the work.

Yes, you're right. Stylesheet compilation doesn't work for schema-aware
stylesheets. However, you can invoke the compile phase separately from the
execute phase from the Java API.

  Saxon-SA does excatly what I want, but only in template rules
matching on schema-element() (if I understand correctly).  

That's not an exhaustive list of the places where type-checking is done!
It's done for template rules that match on any pattern that provides type
information, for example element(*, my:type); and it's done on functions
that declare the types of their parameters, etc. etc.

If there are places where Saxon-SA isn't reporting static type errors where
you think it could do so, please let me know. There are several possible
reasons for the omission: the most obvious ones being (a) the analysis is
too difficult, (b) I haven't got around to it yet, and (c) the apparent
error is not actually an error in all circumstances (though I do report
warnings in cases where I think it's very likely to be an error).

Category (a) currently includes all cases that involve analysis beyond the
scope of a single template rule or function.

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



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--