Re: EXSLT document-uri

"\"John L. Clark\"" <[email protected]> Tue, 6 Mar 2007 20:54:57 -0500
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <[email protected]>
John,

On 3/6/07, John Perkins <[email protected]> wrote:
> Looking for following type of support. Does ESXLT have plans to help
> in supporting the following? In other words support for something like
> document-uri function of XSLT 2.0 as an extensiuon of XSLT 1.0. Thank
> you.

There has been interest in functionality like this (that is, a
`base-uri` function) since as far back as (at least) 2002[0].  I put
out an experimental specification for a `base-uri` function last
year[1].  As Mike Kay points out[2], though, one must be cautious
about using this to retrieve the document's URI, and so we might also
need a `document-uri` function.  At least for me, that's an open
question that would need to be resolved before anything could be
decided, but there's not a lot of EXSLT development or maintenance
discussion going on. So, in summary, it's on the radar, but there
hasn't been a lot of activity in the EXSLT project for a while.

> When using xslt on the browser to transform static xml it woul be very
> useful to be able to get the uri with parameters so the xslt could use
> the parameters of the uri to conditionally determine what
> "subtransform" to perform.

If you had a `base-uri` or `document-uri` function, you could get this
URI and parse it yourself (possibly using the regular expression
extensions) to make decisions like this, yes.  It might even be
amusing to have a function that parses the URI for you, along the
lines of:

  explode-uri('http://example.org/my/path?foo=val1&amp;bar=val2#frag') ->

  <e:uri original="http://example.org/my/path?foo=val1&amp;bar=val2#frag">
    <e:scheme>http</e:scheme>
    <e:authority>
       <e:host>example.org</e:host>
    </e:authority>
    <e:path>/my/path</e:path>
    <e:params>
      <e:param><e:name>foo</e:name><e:value>val1</e:value></e:param>
      <e:param><e:name>bar</e:name><e:value>val2</e:value></e:param>
    </e:params>
    <e:fragment>frag</e:fragment>
  </e:uri>

Take care,

[0] http://lists.fourthought.com/pipermail/exslt/2002-January/000380.html

[1] http://infinitesque.net/projects/exslt/uri/functions/base-uri/index.html

[2] http://lists.fourthought.com/pipermail/exslt/2002-January/000381.html

-- 
PLEASE NOTE that this message is not digitally signed.  As a result,
you have no strong evidence that this message was actually sent by me.
 Upon request I can provide a digitally signed receipt for this
message or other evidence validating its contents if you need such
evidence.