XFORMS xform:output

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

XFORMS xform:output

Badbetty
Hello folks- I hope someone can shed some light please on the problem
of displaying images in an xform in Firefox.

The model instance data is loaded from 'src' web address and works
fine.

The instance data is then displayed to screen using xform (xquery)
statements, part of which is creating a url from some of the instance
data using 'concat', that points to an image that I want to display.
e.g.
.
.
<xforms:output value="concat('http://somesite.com/images/
52/',wr:IconIndex,'.gif')" mediatype="image/*" />
.
.

But the line above only displays the correctly concatenated text (as a
url) - and does not call the image instead which is what I had hoped.

Firefox has been set to allow load and send to all necessary domains.

What is happening here (or not) please and is it a fault with the
handling of 'mediatype'?
Is there a solution - I did try the binding idea but that failed too?

Thank you for reading and any help.
BB

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: XFORMS xform:output

Urs Holzer
Hello

Badbetty wrote:

> Hello folks- I hope someone can shed some light please on the problem
> of displaying images in an xform in Firefox.
>
> The model instance data is loaded from 'src' web address and works
> fine.
>
> The instance data is then displayed to screen using xform (xquery)
> statements, part of which is creating a url from some of the instance
> data using 'concat', that points to an image that I want to display.
> e.g.
> .
> .
> <xforms:output value="concat('http://somesite.com/images/
> 52/',wr:IconIndex,'.gif')" mediatype="image/*" />
> .
> .
>
> But the line above only displays the correctly concatenated text (as a
> url) - and does not call the image instead which is what I had hoped.
>
> Firefox has been set to allow load and send to all necessary domains.
>
> What is happening here (or not) please and is it a fault with the
> handling of 'mediatype'?
> Is there a solution - I did try the binding idea but that failed too?

As far as I understand
http://www.w3.org/TR/xforms11/#ui-output
The XPath expression in the attribute "value" has to evaluate to the
image data itself, not an URI to the image. You could try
document(concat('http://somesite.com/images/52/',wr:IconIndex,'.gif'))
but I suppose it won't work.
A solution would be to encode the image as base64 in an instance data
and to reference this instance data with the "value" attribute. (And
don't forget to bind this data to type xsd:base64Binary.)
http://www.w3.org/TR/xforms11/#ui-output contains an example.

Greetings
Urs
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: XFORMS xform:output

Urs Holzer

> As far as I understand
> http://www.w3.org/TR/xforms11/#ui-output
> The XPath expression in the attribute "value" has to evaluate to the
> image data itself, not an URI to the image. You could try
> document(concat('http://somesite.com/images/52/',wr:IconIndex,'.gif'))
> but I suppose it won't work.
> A solution would be to encode the image as base64 in an instance data
> and to reference this instance data with the "value" attribute. (And
> don't forget to bind this data to type xsd:base64Binary.)
> http://www.w3.org/TR/xforms11/#ui-output contains an example.

I have to add, that you need to use the attribute "ref" and not "value".
In the specification, I also found: "If the instance node either is of
type or is derived from type xsd:anyURI, then the data is treated as a
URI and dereferenced."
So I guess it would work if you used the "ref" attribute to point to a
node of type xsd:anyURI which contains the URI.

I hope this helps you. And sorry for not testing what I say ...

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: XFORMS xform:output

Badbetty
On 26 Aug, 12:24, Urs Holzer <[hidden email]> wrote:

> > As far as I understand
> >http://www.w3.org/TR/xforms11/#ui-output
> > The XPath expression in the attribute "value" has to evaluate to the
> > image data itself, not an URI to the image. You could try
> > document(concat('http://somesite.com/images/52/',wr:IconIndex,'.gif'))
> > but I suppose it won't work.
> > A solution would be to encode the image as base64 in an instance data
> > and to reference this instance data with the "value" attribute. (And
> > don't forget to bind this data to type xsd:base64Binary.)
> >http://www.w3.org/TR/xforms11/#ui-outputcontains an example.
>
> I have to add, that you need to use the attribute "ref" and not "value".
> In the specification, I also found: "If the instance node either is of
> type or is derived from type xsd:anyURI, then the data is treated as a
> URI and dereferenced."
> So I guess it would work if you used the "ref" attribute to point to a
> node of type xsd:anyURI which contains the URI.
>
> I hope this helps you. And sorry for not testing what I say ...

Hello and thank you for taking time to reply.
I changed the attribute from 'value' to 'ref', but it didnt work
unfortunately.

I cannot convert the images to base 64 and upload them before hand.
The images are url references to go with the xform data once it is
displayed. The references are made up dynamically in the xform
depending on the data.

Thank you again
BB

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: XFORMS xform:output

Aaron Reed
Hi,

You could always use xf:setvalue to do the concat'ing and to set the
value of the node that the xf:output is bound to (using @ref).  Once the
node value is updated by xf:setvalue, the output will be refreshed with
the new image.

Let me know if that doesn't work for you.

--Aaron

Badbetty wrote:

> On 26 Aug, 12:24, Urs Holzer <[hidden email]> wrote:
>>> As far as I understand
>>> http://www.w3.org/TR/xforms11/#ui-output
>>> The XPath expression in the attribute "value" has to evaluate to the
>>> image data itself, not an URI to the image. You could try
>>> document(concat('http://somesite.com/images/52/',wr:IconIndex,'.gif'))
>>> but I suppose it won't work.
>>> A solution would be to encode the image as base64 in an instance data
>>> and to reference this instance data with the "value" attribute. (And
>>> don't forget to bind this data to type xsd:base64Binary.)
>>> http://www.w3.org/TR/xforms11/#ui-outputcontains an example.
>> I have to add, that you need to use the attribute "ref" and not "value".
>> In the specification, I also found: "If the instance node either is of
>> type or is derived from type xsd:anyURI, then the data is treated as a
>> URI and dereferenced."
>> So I guess it would work if you used the "ref" attribute to point to a
>> node of type xsd:anyURI which contains the URI.
>>
>> I hope this helps you. And sorry for not testing what I say ...
>
> Hello and thank you for taking time to reply.
> I changed the attribute from 'value' to 'ref', but it didnt work
> unfortunately.
>
> I cannot convert the images to base 64 and upload them before hand.
> The images are url references to go with the xform data once it is
> displayed. The references are made up dynamically in the xform
> depending on the data.
>
> Thank you again
> BB
>
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

RE: XFORMS xform:output

Klotz, Leigh
"It ought to work" to do bind calculate instead of setvalue.

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Aaron
Reed
Sent: Sunday, August 26, 2007 4:38 PM
To: [hidden email]
Subject: Re: XFORMS xform:output

Hi,

You could always use xf:setvalue to do the concat'ing and to set the
value of the node that the xf:output is bound to (using @ref).  Once the

node value is updated by xf:setvalue, the output will be refreshed with
the new image.

Let me know if that doesn't work for you.

--Aaron

Badbetty wrote:
> On 26 Aug, 12:24, Urs Holzer <[hidden email]> wrote:
>>> As far as I understand
>>> http://www.w3.org/TR/xforms11/#ui-output
>>> The XPath expression in the attribute "value" has to evaluate to the
>>> image data itself, not an URI to the image. You could try
>>>
document(concat('http://somesite.com/images/52/',wr:IconIndex,'.gif'))
>>> but I suppose it won't work.
>>> A solution would be to encode the image as base64 in an instance
data
>>> and to reference this instance data with the "value" attribute. (And
>>> don't forget to bind this data to type xsd:base64Binary.)
>>> http://www.w3.org/TR/xforms11/#ui-outputcontains an example.
>> I have to add, that you need to use the attribute "ref" and not
"value".
>> In the specification, I also found: "If the instance node either is
of
>> type or is derived from type xsd:anyURI, then the data is treated as
a
>> URI and dereferenced."
>> So I guess it would work if you used the "ref" attribute to point to
a

>> node of type xsd:anyURI which contains the URI.
>>
>> I hope this helps you. And sorry for not testing what I say ...
>
> Hello and thank you for taking time to reply.
> I changed the attribute from 'value' to 'ref', but it didnt work
> unfortunately.
>
> I cannot convert the images to base 64 and upload them before hand.
> The images are url references to go with the xform data once it is
> displayed. The references are made up dynamically in the xform
> depending on the data.
>
> Thank you again
> BB
>
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: XFORMS xform:output

Aaron Reed
In reply to this post by Badbetty
Yeah, my thought, though, was that setvalue would probably work better
in this case since it is building the path in pieces with each control
determining a piece and there might not be a desire to have the node
value change until it is completely right.  But that was just my
personal preference.  Leigh is certainly right that @calculate will also
work.

--Aaron

Klotz, Leigh wrote:

> "It ought to work" to do bind calculate instead of setvalue.
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Aaron
> Reed
> Sent: Sunday, August 26, 2007 4:38 PM
> To: [hidden email]
> Subject: Re: XFORMS xform:output
>
> Hi,
>
> You could always use xf:setvalue to do the concat'ing and to set the
> value of the node that the xf:output is bound to (using @ref).  Once the
>
> node value is updated by xf:setvalue, the output will be refreshed with
> the new image.
>
> Let me know if that doesn't work for you.
>
> --Aaron
>
> Badbetty wrote:
>> On 26 Aug, 12:24, Urs Holzer <[hidden email]> wrote:
>>>> As far as I understand
>>>> http://www.w3.org/TR/xforms11/#ui-output
>>>> The XPath expression in the attribute "value" has to evaluate to the
>>>> image data itself, not an URI to the image. You could try
>>>>
> document(concat('http://somesite.com/images/52/',wr:IconIndex,'.gif'))
>>>> but I suppose it won't work.
>>>> A solution would be to encode the image as base64 in an instance
> data
>>>> and to reference this instance data with the "value" attribute. (And
>>>> don't forget to bind this data to type xsd:base64Binary.)
>>>> http://www.w3.org/TR/xforms11/#ui-outputcontains an example.
>>> I have to add, that you need to use the attribute "ref" and not
> "value".
>>> In the specification, I also found: "If the instance node either is
> of
>>> type or is derived from type xsd:anyURI, then the data is treated as
> a
>>> URI and dereferenced."
>>> So I guess it would work if you used the "ref" attribute to point to
> a
>>> node of type xsd:anyURI which contains the URI.
>>>
>>> I hope this helps you. And sorry for not testing what I say ...
>> Hello and thank you for taking time to reply.
>> I changed the attribute from 'value' to 'ref', but it didnt work
>> unfortunately.
>>
>> I cannot convert the images to base 64 and upload them before hand.
>> The images are url references to go with the xform data once it is
>> displayed. The references are made up dynamically in the xform
>> depending on the data.
>>
>> Thank you again
>> BB
>>
> _______________________________________________
> dev-tech-xforms mailing list
> [hidden email]
> https://lists.mozilla.org/listinfo/dev-tech-xforms
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms