[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XSLT 2.0 processor signalling error, for type erro

Subject: RE: XSLT 2.0 processor signalling error, for type errors
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 8 Oct 2008 13:01:51 +0100
RE:  XSLT 2.0 processor signalling error
> Just out of curiosity, if I write say
> 
> int i = "abc";
> 
> in Java
> 
> I would get a compilation failure (even if the variable is not used).

Java is a statically-typed language.
> 
> Most of the time, XSLT compiles the program and executes it 
> in one pass. Can we say XSLT is a interpreted language, like 
> say JavaScript?

Compiled vs interpreted is a matter of the processor implementation, nothing
to do with the language itself. And it's a pretty fuzzy distinction these
days, because most processors actually compile down to some intermediate
representation which is then interpreted by some kind of virtual machine:
the question is how close that representation is to machine code. JIT
compilation makes it even fuzzier.

A clearer distinction is between strongly-typed and weakly-typed languages,
or (almost the same) statically-typed and dynamically-typed. XSLT is
essentially dynamically-typed (meaning type-checking isn't done until
runtime) except that there's provision for optional optimistic static typing
- which means you can report a compile-time error if you find a construct
that's guaranteed to fail if executed at run-time (as in your example), but
not (like Java) if there's merely a possibility that it might fail.

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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.