Re: xf:output, @mediatype and @value

Hi Philipp,

The most natural reading is that the mediatype attribute is simply ignored 
when an output has a value attribute and not a single node binding. Output 
with a single node binding can be further qualified by the mediatype 
attribute.  Output with a value attribute only shows the string result of 
the value attribute's expression.

Cheers,
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: 
http://www.ibm.com/developerworks/blogs/rss/JohnBoyer?flavor=rssdw





From:
Philipp Wagner <news@philipp-wagner.com>
To:
www-forms@w3.org
Cc:
ebruchez@orbeon.com
Date:
08/12/2009 09:52 AM
Subject:
Re: xf:output, @mediatype and @value



Hi John,

John Boyer wrote:
> The configuration of using mediatype with the value attribute is
> explicitly not supported by the specification.
>
> [...]
>
> The correct way to activate the feature would be like this:
> 
> <xf:model ... namespace declarations ...>
>    <xf:instance>
>       <myData xmlns="">
>          ...
>          <image>myPicture.png</image>
>       </myData>
>    </xf:instance>
> 
>    <xf:bind nodeset="myPicture" type="xsd:anyURI" />
>    ...
> </xf:model>
> ...
> <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. 

This way of displaying an image is clear and also supported by Mozilla
XForms.

> 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.

OK. So you suggest removing support for that markup variation and filing
a bug report with Orbeon? What should we output instead? The string (and
ignoring @mediatype) or nothing (as the string cannot be displayed as
image)?

@Erik Bruchez: why did you add this variation in the first place? Do you
see a use case for this?

Philipp



> From:                  Philipp Wagner <news@philipp-wagner.com>
> To:            www-forms@w3.org
> Date:                  08/11/2009 02:11 PM
> Subject:               xf:output, @mediatype and @value
> 
> 
> ------------------------------------------------------------------------
> 
> 
> 
> Hi,
> 
> recently Mozilla XForms got a bug report [1] that the following is not
> working:
> 
> <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.
> 
> Philipp
> 
> 
> [1] https://bugzilla.mozilla.org/show_bug.cgi?id=507621
> [2]
> 
http://www.orbeon.com/ops/doc/reference-xforms-guide#xforms-image-mediatype

Received on Wednesday, 12 August 2009 18:54:38 UTC