W3C home > Mailing lists > Public > public-xml-processing-model-comments@w3.org > November 2008

Re: Errors in definition of XPath static context

From: Florent Georges <fgeorges@fgeorges.org>
Date: Wed, 19 Nov 2008 15:40:52 +0100
Message-ID: <ebaca5bf0811190640r34545aa4ma1478001126c7986@mail.gmail.com>
To: "Henry S. Thompson" <ht@inf.ed.ac.uk>
Cc: "Norman Walsh" <ndw@nwalsh.com>, public-xml-processing-model-comments@w3.org

2008/11/19 Henry S. Thompson wrote:


> My understanding, which could be wrong, is that the _static_
> context is what is the same for _every_ evaluation episode,
> whereas the _dynamic_ context is what may change - From one
> episode to the next.  It follows that the static context is for
> XSLT 2 is determined by the stylesheet context and the dynamic
> context is determined by (things dependent on) the source
> document(s).

  That's more or less the idea, but not exactly that.  For
instance, if you have a function like:

    <xsl:function name="my:double">
       <xsl:param name="num"/>
       <xsl:sequence select="$num + $num"/>

and you call it like this:

    <xsl:sequence select="my:double(1), my:double(2)"/>

there is nothing depending on the source document (but it could for
another call,) while the value of $num (part of dynamic context)
will be different in both evaluations.

  So more precisely, I think the idea is that the static context is
what one can associate to any instruction in the stylesheet and
that won't change ever for that instruction (only by looking t the
stylesheet,) while the dynamic context is the part that could
change between two different evaluations of the same instruction,
in a unique run of the stylesheet.  Input documents are one of the
cause a dynamic context component can change, but not the only one.

  But regarding the issue raised by Norman, I think you are right,
what is in the current WD is correct, and is in the same spirit as
the XPath 2.0 static context.

  Hope that helps,

Florent Georges
Received on Wednesday, 19 November 2008 14:41:28 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:28:26 UTC