W3C home > Mailing lists > Public > www-forms@w3.org > August 2009

Re: xf:output, @mediatype and @value

From: John Boyer <boyerj@ca.ibm.com>
Date: Tue, 11 Aug 2009 15:39:15 -0700
To: Philipp Wagner <news@philipp-wagner.com>
Cc: "www-forms@w3.org" <www-forms@w3.org>
Message-ID: <OF83A706BD.116A4F5C-ON8825760F.00752B55-8825760F.007C72E3@ca.ibm.com>
HI Philipp,

It is no bug in the FF plugin.  Also, the spec does not need 

The configuration of using mediatype with the value attribute is 
explicitly not supported by the specification.

The mediatype attribute helps an output control to determine how to render 
data obtained from the single node binding only.  This is necessary 
because the XForms data model provides the additional expressivity needed 
to pull off the feature correctly (via the type model item property in 
this case).  The value attribute is only capable of providing a string of 
text.  It is not possible currently to indicate that the string is a base 
64 encoding of the image or a URL to be dereferenced, or what have you. 

The correct way to activate the feature would be like this:

<xf:model ... namespace declarations ...>
      <myData xmlns="">

   <xf:bind nodeset="myPicture" type="xsd:anyURI" />
<xf:output ref="myPicture" mediatype="image/*"> ... </xf:output>

So, it's not that the feature isn't there.  It's just that the feature is 
activated via different markup.  In this situation, a particular 
implementation has added/supported a custom alternative markup pattern.  I 
hesitate to call it an "extension" because usually that term is reserved 
for things which are not otherwise achievable by the specification.  While 
it is usually the case that one reports a bug when something doesn't 
appear, in this case the implementation should receive a bug report 
because the image does appear when the value attribute is used to provide 
an image filename.  This is necessary in order to avoid creating exactly 
this kind of confusion across implementations, and it also helps to ensure 
that the correct markup pattern is used to activate the feature in a way 
that is interoperable across implementations.

Finally, hopefully with the connection to data, it might be clearer why 
this mechanism is preferable to just using an img tag.  One can change the 
data node, e.g. with a setvalue action or with a web service result, and 
the image rendered by the output will change as a result.

John M. Boyer, Ph.D.
STSM, Interactive Documents and Web 2.0 Applications
Chair, W3C Forms Working Group
Workplace, Portal and Collaboration Software
IBM Victoria Software Lab
E-Mail: boyerj@ca.ibm.com 

Blog: http://www.ibm.com/developerworks/blogs/page/JohnBoyer
Blog RSS feed: 

Philipp Wagner <news@philipp-wagner.com>
08/11/2009 02:11 PM
xf:output, @mediatype and @value


recently Mozilla XForms got a bug report [1] that the following is not

<xf:output mediatype="image/png" value="'xml.png'"/>

Expected behavior was displaying the image. The real use case for this
remains unclear (you could just use a html:img in that case or whatever
the host language provides you to display images).

While the fix is straightforward, a question remains:
Are we always supposed to treat @value as anyURI if @mediatype is set to
"image/*"? Orbeon seems to do this for at least this case as well [2].
Are there other cases where we should/could make such an assumption?

A clarification would be greatly appreciated.


[1] https://bugzilla.mozilla.org/show_bug.cgi?id=507621
Received on Tuesday, 11 August 2009 22:40:01 UTC

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