Re: replace an instance uploading an xml file

Federico,

I'm not sure of understanding your approach, but it seems that changes the
@src of the instance data by the location of the input data introduced by
the user. Then, the instance data is reloaded from the new source?

Even so, I will have problems if I want that the instance data will contain
more data than the user can introduce with their xml file. I could divide
the instance data in more instances data, and replacing one of them with
those of the user input, but I suppose that then I would have problems to
submitting all of them.

Leigh,

You might think that doing this in JavaScript would be easier and keep the
action all on the client, but most user agents prevent scripted access to
local file data.

But if the file is loaded, is not supposed that user wants to send to the
web? Loading a file can't be interpreted like giving permission... or not?

Thanks to both. I will be doing the cgi, it seems to be the best option for
me.

Iņaki


2007/1/11, federico gimenez <federico.gimenez@gmail.com>:
>
> 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 15:46:54 UTC