W3C home > Mailing lists > Public > www-forms@w3.org > April 2010

RE: New XPath extension function called xslt()

From: Nick Van den Bleeken <Nick.Van.den.Bleeken@inventivegroup.com>
Date: Thu, 15 Apr 2010 14:20:38 +0200
To: claud108 <claud108@yahoo.com>, "www-forms@w3.org" <www-forms@w3.org>
Message-ID: <98F519CDC2FA6146AE00069E9A1D91FD87074442A6@erganix.dc.intranet>
Hi Claudius,

There are already a couple of implementations that have this feature, because they are based on Saxon. Saxon has an extension function saxon:transform()[1].

>From Saxons' documentation: "This function takes as input a compiled XSLT stylesheet, and uses it to transform a source document into a result document. The first argument will generally be the result of calling the saxon:compile-stylesheet()  extension function. The second argument can be any node (usually a document node or element node), either read from external filestore using the doc() or document() function, or constructed programmatically..." (see [1] for the full description)

Saxon has a separate extension function saxon:compile-stylesheet()[2] (the result can be stored in a variable) because the 'compilation' process of stylesheet is quite heavy.

In your proposal this isn't strictly needed because you have a URI for a stylesheet and therefore you can calculate a last modified date. In Saxon's case it is node that contains the stylesheet. This approach has the advantage that you could create the stylesheet dynamically (based on data) but has the drawback that it is hard to know if you already have a compiled version of the stylesheet. (If you have the stylesheet available at a URI, you can use the doc() or document() function to parse the stylesheet document).

If we are going to standardize the function, I'm personally a bit leaning to the version that has the stylesheet as a node because it is more flexible. For the option having two functions (one that compiles the stylsheet and one that does the transform) opposed to just one, I'm a bit puzzled because I would prefer the two functions but we don't have variables in XForms yet, so there wouldn't be a lot gained with having two functions yet. Nevertheless I'm using variables a lot (they make forms authoring easier and require less evaluations of complex expressions at runtime), so I think we could go here with the two separate functions (compile and transform) because we will add support for variables hopefully sooner then later.

What is your opinion about this? (Definitely about having a node as input of the stylesheet opposed to the URI)


Nick Van den Bleeken
R&D Manager

Phone: +32 3 821 01 70
Office Fax: +32 3 821 01 71
Linked in

1: http://www.saxonica.com/documentation/extensions/functions/transform.html
2: http://www.saxonica.com/documentation/extensions/functions/compile-stylesheet.html

> -----Original Message-----
> From: www-forms-request@w3.org [mailto:www-forms-request@w3.org] On Behalf
> Of claud108
> Sent: donderdag 15 april 2010 13:25
> To: www-forms@w3.org
> Subject: New XPath extension function called xslt()
> Hi all,
> I have made some extension for XSLTForms (see
> http://extxsltforms.sourceforge.net here ).
> Among these extensions, I've an xslt action, which performs a xsl
> transformation of a nodeset (part of a data instance), by using an
> external
> XSL stylesheet, and inserts the resulting nodeset in a data instance (see
> http://extxsltforms.sourceforge.net/sitKubera/examples/xslt_action/test_xs
> lt_action.xml
> here ).
> After analyzing this xslt action, the Forms WG concluded that an XPath
> extension function called xslt() would be more appropriated (see
> http://www.w3.org/2010/03/25-forms-minutes.html here ).
> So, Leigh Klotz suggested the following syntax example:
> <submission method="post" ref="ex:xslt(.....)" resource="save.cgi" />
> where @ref should be considered by xslt() as xml doc to be transformed.
> Such usage is very nice and appropriate, as allows user to make some
> client
> XSL transformations before sending data to server.
> I but I think that I would be more than useful if such XSL transformations
> can be made also during filling the form by user.
> In this regard, I would like to ask the community for ideas regarding the
> syntax and usage of xslt().
> Thank you,
> Claudius Teodorescu
> -----
> Claudius Teodorescu
> http://kuberam.ro
> --
> View this message in context: http://old.nabble.com/New-XPath-extension-
> function-called-xslt%28%29-tp28254037p28254037.html
> Sent from the w3.org - www-forms mailing list archive at Nabble.com.
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> --

Inventive Designers' Email Disclaimer:

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thursday, 15 April 2010 12:21:19 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:23 UTC