W3C home > Mailing lists > Public > www-forms@w3.org > March 2006

RE: Content Type

From: Mark Birbeck <mark.birbeck@x-port.net>
Date: Tue, 21 Mar 2006 14:45:00 -0000
To: <www-forms@w3.org>
Message-ID: <026801c64cf6$080d4130$0e01a8c0@Jan>

Sylvain,

> I was wondering if XForms had a Content-Type associated to it 
> such as application/xforms+xml. I have not seen any on the 
> IANA website nor anywhere else. Please forgive me if I 
> haven't looked carefully enough.

As Victor said earlier, it doesn't have such a type. What we need is
actually some kind of 'sub-type' mechanism that lets us know that the
browser has a plug-in installed--there are a number of suggestions on how to
solve this, but nothing has been firmed up yet.


> I'm asking that because I often setup my web application to 
> use Content negotiation and serve content based on what the 
> UA says it supports. For instance Firefox says it accepts 
> application/xhtml+xml when Internet Explorer does not. I 
> serve XHTML in the first case and HTML otherwise.
> 
> In the case of XForms, if the UA does not support XForms 
> natively or via an extension, I would serve my XForms 
> document through XHTML and I would add a call to FormFaces 
> (the Javascript XForms implementation as you all know). 
> Basically, I would like to use the native XForms 
> implementation if there and FormFaces otherwise.
> 
> Maybe this does not make much sense though :)

It makes perfect sense, and is a very good set-up.

Note also that if the user has Sidewinder installed then the Internet
Explorer 'Accept' header is modified to include 'application/xhtml+xml'. If
a document of type XHTML is returned from the server then Sidewinder is
invoked by IE to handle the document in-place (like a PDF document, for
example).  Part of our processing is to connect up any plug-ins that are
installed that can process languages that can be embedded in XHTML, such as
formsPlayer, MathPlayer and the Adobe SVG Viewer (for XForms, MathML and
SVG, respectively).

This means that if you have formsPlayer installed, all the XForms parts of
the document will be processed automatically, and as a consequence your
server can deliver 'pure' XHTML+XForms documents to both IE and Firefox,
that are pretty much the same--pages delivered to IE with Sidewinder
installed don't need the usual object/import tags, although everyone is well
aware of the CSS problems in IE. (Some of these are solved in IE7, and some
we're addressing within Sidewinder itself.)


Of course this just makes IE much the same as Firefox, since there is still
no standard way of telling if the presence of 'application/xhtml+xml' means
that it is safe to conclude that the UA supports XForms; in the case of IE,
Sidewinder is a separate installation to formsPlayer, and in the case of
Firefox the XForms plug-in may not be installed.

However, for IE, once formsPlayer is installed the string 'formsPlayer' will
be present in the user agent string, so anyone interested in using this
technique could check for that, and then drop through to a download page or
FormFaces if required:

  if (Accept does not contain "application/xhtml+xml")
    offer download pages, or use FormFaces;
  else {
    if (Browser == IE) {
      //Sidewinder is present to have got here, but fP
      // may not be
      if (UAString contains "formsPlayer 1.x")
        deliver XHTML+XForms page;
      else
        offer download pages, or use FormFaces;
    }
    else if (Browser == Firefox) {
      deliver XHTML+XForms page;
    }
  }


More information on how Sidewinder handles 'application/xhtml+xml' is here:

  <http://skimstone.x-port.net/index.php?q=node/181>

There are still some problems we need to iron out with this, so anyone who
decides to take a look at this approach, please feel free to report bugs in
the forum. Even with the current release though, you'll see that you can
navigate to the samples on the Mozilla XForms project page with IE, and see
them open directly in the browser. (The tax demo and calculator work fine,
but unfortunately, the insurance demo has a namespace declaration in a
position that formsPlayer can't detect, which makes formsPlayer incorrectly
report that the instance data is in error when it isn't...we'll fix that
shortly.)

Regards,

Mark


Mark Birbeck
CEO
x-port.net Ltd.

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

Download our XForms processor from
http://www.formsPlayer.com/
Received on Tuesday, 21 March 2006 14:45:26 GMT

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