W3C home > Mailing lists > Public > www-forms@w3.org > July 2004

RE: Displaying XML _as_ XML

From: Mark Birbeck <mark.birbeck@x-port.net>
Date: Mon, 26 Jul 2004 11:33:53 +0100
To: "'Shazib E. Shaikh'" <shazib.shaikh@student.umist.ac.uk>
Cc: <www-forms@w3.org>
Message-ID: <004c01c472fc$0c432ab0$6f01a8c0@W100>

Hi Shazib,

> I want my xform to show a part of my xml instance
> _as_ xml (with tags and all) in a text area.

Now, do you mean "textarea" or "text area"? ;)

If you are simply looking to render some output (i.e., you want a "text
area"), then there is no standard way of doing this in XForms, but
implementations can provide ways to do this if they like. I am not aware of
this feature in processors other than formsPlayer, but our solution is to
use an XPath function:

  <xforms:output value="fp:HTMLserialise(/)">
    <xforms:label>Contents of instance data</xforms:label>

The function takes a node and 'pretty-prints' an XML version of the node and
all its children. As you'd expect since this is just a normal form control,
the output changes as the instance data changes.

A full example, showing how to use this feature for simple debugging, is
given here:


However, if you are looking to use a textarea control to edit a tree, then
this is not currently possible with XForms 1.0, since controls can only bind
to simple content. However, it is an extremely important use case (required
for blogs, content management systems, and so on), so there will hopefully
be some resolution to this within the specification.

In the meantime, as an experiment - and to get feedback from forms
developers - we've added an HTML editor to formsPlayer, available as an
extension to the xf:textarea control. This will be available in 'fP:2.0 with
Custom Controls', a beta of which will be available *very* soon.



Mark Birbeck
x-port.net Ltd.

e: Mark.Birbeck@x-port.net
t: +44 (0) 20 7689 9232
w: http://www.formsPlayer.com/

Download our XForms processor from
Received on Monday, 26 July 2004 06:34:13 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:13 UTC