RE: loading instance as .XML page

You might be able to use the data: url scheme if you had a way to serialize the instance to a string, either an extension function or an offbox submission that does it.

<xf:bind nodeset="instance('serialized')/dataURI" calculate="concat('data:', instance('results')/serialized)" />
<xf:submission method="post" action="serialize-to-string.cgi" ref="instance('generalRequest')" replace="instance" instance="serialized">
  <xf:load ev:event="xforms-submit-done" show="new" ref="instance('serialized')/dataURI" />
</xf:submission>

-----Original Message-----
From: www-forms-request@w3.org [mailto:www-forms-request@w3.org] On Behalf Of Mark Birbeck
Sent: Wednesday, April 25, 2007 12:47 PM
To: www-forms
Subject: Re: loading instance as .XML page


Hi Iņaki,

> I would know, is it possible to load a XForms instance in a new page as a
> XML document?
>
> I tried using:
>
> <xforms:load show="new" ref="instance('generalRequest')" />

The value that you get from @ref is used as a URL, I'm afraid. The
only way to achieve what you want is to let the instance that you are
trying to retrieve replace the current page, using a submission with
@replace set to "all".

Having said that, it's an interesting use case, and perhaps you should
look at turning it into a feature request. A good place to start would
be to give some illustrations of the kinds of things you are trying to
do.


> but it loads the entire XHTML document another time!
> (I must say that there are a warning 'Instance document did not validate'
> related with this instance)

It's probably because there is no URL in your instance, but I couldn't
be certain.


> And if the instance src attribute loads an XML document with a call to a
> XSLT: will be this XSLT applied in the loaded instance?

Do you mean an XSLT processing instruction is in the XML? I doubt that
this would be processed within an XForms instance.

Regards,

Mark


-- 
  Mark Birbeck, formsPlayer

  mark.birbeck@x-port.net | +44 (0) 20 7689 9232
  http://www.formsPlayer.com | http://internet-apps.blogspot.com

  standards. innovation.

Received on Wednesday, 25 April 2007 21:34:47 UTC