[Top] [All Lists]

RE: Static type-checker

2005-11-18 07:25:59
Michael Kay wrote:

It's always a good idea to declare the types of
your variables explicitly.

  I agree.  But my problem is a quite more complex.  I generate XSLT
from personal XML format (with XSLT, indeed).  The XML doc can use
XPath expressions in some contexts.  I generate some variables the XML
doc can use.

  The XML doc can create its own variables (almost shortcuts for
clarity of the document).  And I don't really like the idea of asking
users to declare the type of the variables they create (the view they
have of the big picture is really simplified).

  After having worked on a document, the user runs a transformation in
validation mode.  The goal is only to detect as more as possible typos
(and to discover new features of XPath/XSLT 2.0 from my point of view

  Because it's in a testing phase, and that I know the used schemas and
the type of the initial variables, I could create an additional
transformation to infer myself the type of the user-created variables
(maybe in XSLT, but it's quite complex, IMHO).

However, you can expect that Saxon will gradually
get smarter in its checking in future releases.


the use of a path expression like
$list/my:zorglub[1] is not an error

  Yes I know.  But in my case, we know exactly the type of the
manipulated elements, and we never have to wrote such an XPath
expression (that selects an unknow child of an element, knowing its

  Thanks a lot for all these precisions,



Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger 
Téléchargez cette version sur http://fr.messenger.yahoo.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>