W3C home > Mailing lists > Public > public-html@w3.org > May 2007

Re: WF2, attach hidden xml

From: Bruce Boughton <bruce@bruceboughton.me.uk>
Date: Wed, 23 May 2007 15:34:21 +0100
Message-ID: <465450ED.6090805@bruceboughton.me.uk>
To: Tom Morris <bbtommorris@gmail.com>
CC: HTML WG <public-html@w3.org>
Tom Morris wrote:
>
> On 5/21/07, Dmitry Turin <html60@narod.ru> wrote:
>>
>> I not found how to add abitrary xml-tree to sending xml-tags,
>> i.e. how to attach _hidden_ xml-tree to form.
>> Thus i offer new html-element <hidden>,
>> and i offer to place mentioned xml-tree inside it,
>> for example
>
> I'm not sure that 'hidden' is the right title for such an attribute,
> but I think there is some value in having a method by which one can
> include XML data in to HTML. The browser need not *do* anything with
> it (just as it need not 'do' anything with microformats), but could
> optionally do something with it. If you see user agents as only
> Internet Explorer, Firefox and Safari, this will be somewhat pointless
> - but for the 'long tail' of user agents, there is a great deal of
> value in being able to extract 'purer' XML data from an (X)HTML
> document.
>
> (X)HTML documents are being used as method for moving data around, and
> having a number of viable approaches means that it's less likely for
> people to have to engage in ugly 'hacks' or break the CSS/style use of
> elements and attributes.
>
Something along the lines of:

<form>
<textarea name="hiddenXMLdata" readonly="readonly" style="display: none">
<![CDATA[
<?xml version="1.0">
<myxml>
  <somexml>Hello</somexml>
</myxml>
]]>
</textarea>
<input type="submit" value="Submit"/>
</form>

Granted this is hacky but I think some of the basis for what is 
requested is already available.  We essentially want an <input 
type="hidden"> whose contents is its children rather than an attribute 
value.

The problem with the above example (ignoring the semantics) is that 
textarea in Firefox at least the CDATA declarations appear inside the 
textarea.  Is this correct for an element whose content is PCDATA?  (I 
don't know)

Bruce
Received on Wednesday, 23 May 2007 14:34:47 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:15:58 GMT