RE: [xsl] Static type-checker

Subject: RE: [xsl] Static type-checker
From: drkm <darkman_spam@xxxxxxxx>
Date: Fri, 18 Nov 2005 15:25:59 +0100 (CET)
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
:-p).

  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.

  Great!

> 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
type).

  Thanks a lot for all these precisions,

--drkm



















	

	
		
___________________________________________________________________________ 
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger 
Tilichargez cette version sur http://fr.messenger.yahoo.com

Current Thread
  • RE: [xsl] Static type-checker
    • drkm - Thu, 17 Nov 2005 17:19:51 +0100 (CET)
      • <Possible follow-ups>
      • drkm - Fri, 18 Nov 2005 12:47:13 +0100 (CET)
      • drkm - Fri, 18 Nov 2005 15:25:59 +0100 (CET) <=
      • drkm - Fri, 18 Nov 2005 15:43:55 +0100 (CET)
      • drkm - Fri, 18 Nov 2005 17:09:48 +0100 (CET)