- From: Michael Fuller <msf@io.mds.rmit.edu.au>
- Date: Fri, 4 Feb 2000 14:41:56 +1100
- To: xsl-list@mulberrytech.com
- Cc: xsl-editors@w3.org
The XSLT extenstion function "system-property()" (XSLT 12.4) is
defined with a return type of "object":
object system-property(string)
As far as I can tell, this is the only instance in XPath and XSLT
where the return type cannot be explicitly known during parsing,
but instead must be dynamically determined at run-time.
This makes implementing a type-safe XPath expression parser/evaluator
_significantly_ more complicated.
The example properties shown in the description of system-property() are:
xsl:vendor -- a string
xsl:vendor-url -- a string
and
xsl:version -- a number
Clearly, the return-type of system-property() has been defined as
"object" to allow xsl:vendor(-url) and xsl:version to co-exist.
The cost seems high, though, given that by restricting the return type to
be "string" provides _almost_ identical functionality; the only situation
where it would differ is when evaluating an XPath expression such as:
system-property("xsl-version") == 1
(i.e. the string "1.0" is not the same as the string "1")
-- which is unfortunate, although perhaps a small cost.
Given that allowing dynamic typing significantly weakens the type-safety
of the XPath model, would the XSLT editors consider changing the definition
of system-property() to:
string system-property(string)
??
Michael Fuller
____________________________________________
http://www.mds.rmit.edu.au/~msf/
Multimedia Databases Group, RMIT, Australia.
Received on Thursday, 3 February 2000 22:42:15 UTC