W3C home > Mailing lists > Public > www-forms@w3.org > April 2005

Re: How can a text file be uploaded by XForms?

From: Victor Engmark <victor.engmark@cern.ch>
Date: Fri, 22 Apr 2005 09:23:05 +0200
Message-ID: <4268A659.8040807@cern.ch>
To: Mark Birbeck <mark.birbeck@x-port.net>
CC: 'Kianoush Eshaghi' <Kianoush.Eshaghi@metadat.at>, www-forms@w3.org

Mark Birbeck wrote:

>Kianoush,
>
>Can I just check that I understand the issue? Are you saying that you want
>to upload the file 'as is'? That is, you don't want to see it to be stored
>in a binary or hex format?
>
>If so, then I am afraid that can't be done in XForms 1.0, although it
>certainly wouldn't be difficult to do. At the moment the specification says
>that you must bind to an element with a schema type of one of the binary
>types -- which is why formsPlayer correctly "cries" if you use a type of
>xsd:string ;).
>
>However, just having the raw text is certainly a good suggestion for XForms
>1.1.
>  
>
I'd expect that you still would have to escape characters in /some/ way, 
unless you have specialized parsers which know to treat XForms instance 
data. With this in mind, the most obvious encodings which come to mind are:

    * Just escaping <, &, and > as &lt;, &amp;, and &gt; (this is not
      complete enough to handle all data, but should be enough for most
      non-binary stuff)
    * The above generalized to XHTML - That is, including entities like
      &copy; without messing up the parsing of the XML (can this be done
      with a DTD?)
    * Generalized even further to escape other non-valid characters,
      such as mentioned in message-ID <4267FF98.8030803@bruchez.org> (is
      this sufficient to handle any binary data?)

Frankly, these encodings are IMNSHO so obvious that I'm starting to 
suspect that my understanding of the concept of "encoding" is 
fundamentally flawed. If this is not the case, how come these encodings 
have not been included in XForms 1.0? They would be very useful to be 
able to display the raw data that is sent with a form, and for e.g. web 
authoring XForms (preview of result).

-- 
Victor Engmark
"Quid quid latine dictum sit, altum viditar" - "What is said in latin, 
sounds profound"
Received on Friday, 22 April 2005 07:23:09 GMT

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