[ACTION-1803] XForms Transformation Module

Gentlemen,

I have created a new wiki page for the proposed 'XForms Transformation Module'

<http://www.w3.org/MarkUp/Forms/wiki/The_XForms_Transform_Module>

Which uses the 'XForms Submission Module' as a template for defining a transformation element that declares a transformation on an XForms instance. It does not attempt to explain how the transformation is invoked beyond mentioning that it would be done via referencing the transformation's ID. The simple case of the transform being referenced by URI is described.

However we still need to think about how one deals with transforms referenced from an XForms instance. Personally I would not have a problem with the transform only being referenced from an XForms instance. If that were the case then you have all the existing mechanisms for loading the transform:

<instance id="view-tx" src=""/>

<instance id="view-tx" resource=""/>

<instance id="view-tx">
  <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    ...
  </xsl:transform>
</instance>

and via an xf:submission to a named instance. Further more you have all the associated error handling that you can use too.

The question would be: what are the operational overheads of using an XForms instance to the hold the transform as opposed to referencing it directly.

Some other alternatives that I haven't written-up on the wiki, as yet, include the following use and extension of the resource element. The first two are standard, the third re-uses the instance and ref attributes from the parent transformation element. The final four take a leaf from XProc's book and define the 'type' of a resource as XML document, unparsed character data (XQuery), in-line mark-up or an XForms instance. XProc seems to have solved the problem of XML documents vs. Text formats by use of the p:document and p:data instructions for a stylesheet/query input source port which equates to the XForms submission/transformation resource.

<transformation id="tx" ref="instance('data')" instance="view">

  <!-- Transform URI value from instance data. -->
  <resource value="/link[@rel = 'stylesheet']/@href"/>

  <!-- Transform URI value from a static string value. -->
  <resource>/tx/foo.xsl</resource>




  <!-- Transform from an XForms instance data. -->
  <resource instance="view-tx" ref="/"/>



  <!-- Transform is an XML document (XSLT or XProc). -->
  <resource>
    <document href="/tx/foo.xsl" content-type="application/xslt+xml"/>
  </resource>

  <!-- Transform is unparsed text (XQuery). -->
  <resource>
    <data href="/tx/foo.xqy" content-type="application/xquery"/>
  </resource>

  <!-- Define the transform in-line within the transformation declaration. -->
  <resource>
    <inline>
      <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        ...
      </xsl:transform>
    </inline>
  </resource>

  <!-- The transform is contained within an XForms instance. -->
  <resource>
    <instance ref="instance('view-tx')"/>
  </resource>
</transformation>



Regards


Philip Fennell
Consultant
MarkLogic Corporation

Phone +44 (0) 203 402 3619  |  Mobile +44 (0) 7824 830 866

email  Philip.Fennell@marklogic.com<mailto:Firstname.Lastname@marklogic.com>
web    www.marklogic.com<http://www.marklogic.com/>

This e-mail and any accompanying attachments are confidential. The information is intended solely for the use of the individual to whom it is addressed. Any review, disclosure, copying, distribution, or use of this e-mail communication by others is strictly prohibited. If you are not the intended recipient, please notify us immediately by returning this message to the sender and delete all copies. Thank you for your cooperation.

Received on Wednesday, 1 June 2011 12:18:31 UTC