W3C home > Mailing lists > Public > www-forms@w3.org > January 2007

Re: replace an instance uploading an xml file

From: federico gimenez <federico.gimenez@gmail.com>
Date: Thu, 11 Jan 2007 08:51:45 +0100
Message-ID: <4a79814f0701102351m66e9500cvbef55c8bd40a16bc@mail.gmail.com>
To: "Iņaki Salinas Bueno" <inksalinas@gmail.com>
Cc: www-forms <www-forms@w3.org>

Hi all

Iņaki, in our client-side XForms-based xml editor we took the
following approach: we split the editor into two xhtml files, one for
selecting the name of the file to be edited (the XForms-selector) and
other for editing (the XForms-editor).

Since the XForms-editor is a xml file itself, can be loaded, changed
and saved by the XForms-selector. From the XForms-selector, we select
the name of the xml file to be edited (in our approach this is done
with a simple xforms:input field, but could be done with an upload
control used just to get the name of the file...). Then we load the
XForms-editor into an instance, change the src attribute of its data
instance, write it to disk and xforms:load it configured.

Surely there is a better way to do this, any thoughts are welcome.

Federico

2007/1/10, Iņaki Salinas Bueno <inksalinas@gmail.com>:
> Hello,
>
> I'm trying to use the upload control to select an xml file that must replace
> an instance.
>
> The initial instance data is loaded from "inital.xml". I want to give the
> user the option to load his own personal data instead of filling the form.. I
> suppose that xforms is prepared for this, but how?
>
> If I try this:
>
> <xforms:upload ref="instance('the_instance')">
>      <xforms:label>File to upload</xforms:label>
> </xforms:upload>
>
> Mozilla says:
>  Error: XForms Error (40): upload element not bound to valid datatype.  Must
> be bound to one of these datatypes or a type derived from one of these
> datatypes: xsd:anyURI xsd:base64Binary xsd:hexBinary.
>
>
> If I try this:
> <xforms:upload bind="the_intance">
>      <xforms:label>File to upload</xforms:label>
> </xforms:upload>
>
> Mozilla says:
> Error: XForms Error (8): id (the_instance) does not refer to a bind element
>
>
>
>
Received on Thursday, 11 January 2007 16:01:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:08 GMT