W3C home > Mailing lists > Public > public-xformsusers@w3.org > May 2016

ACTION-2066: Compare the 4 different transform() functions and report

From: Erik Bruchez <erik@bruchez.org>
Date: Tue, 17 May 2016 21:33:30 -0700
Message-ID: <CAAc0PEXmXTFr76ErDe8B=xuPW4M-RjfHX0BwbfPJFvtvKh0wRw@mail.gmail.com>
To: "public-xformsusers@w3.org" <public-xformsusers@w3.org>
All,

A few notes comparing the 2 transform() functions (not 4!) we talked about:

1. Proposed XForms function

- takes transform URI as string
- takes input document as node
- dispatches an event in case of error (Erik: doesn't like)
- contemplates possibilities for in-form transforms
  - no solution decided yet
- extension to pass parameters
   - as XML doc
   - params passed to transformation
   - XSLT configuration

2. XPath 3 function

- takes a single XPath 3.0 map (hashmap) for params
- supports XSLT by location (URI), node, or even text
- supports XSLT configuration (via map)
- supports params passed to transformation (via another map)
- supports returning multiple result documents
- error handling via dynamic errors

XForms 2.0 is currently based on XPath 2.0 and doesn't support XPath
3.0's maps. We probably don't want to mandate XPath 3.0 at this time
(although it would be great to have XPath 3.0).

Semantically, the 2 functions are very similar: the XPath 3 version is
more flexible. I would suggest, for XForms 2.0, to specify a version
of transform() which is semantically as close as the XPath 3.0 version
without requiring support for maps.

One possible way could be something like:

  xf:transform(
      $param-names as xs:string+,
      $param-values  as item()+,
      $result-names as item()*
  ) as item()*

But we would need to spell it out on more details to see how this would go.

Regards,

-Erik
Received on Wednesday, 18 May 2016 04:34:18 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:37:46 UTC