Problem with <xforms:output mediatype="image/jpeg" value="..."/>

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

Problem with <xforms:output mediatype="image/jpeg" value="..."/>

f.blanc
Hi,

I want to generate an image via the jpg.xpl and display the result in a xslt view. The image is correctly generate (if I forward the output of jpg.xpl to an html-serializer, the browser display the image correctly) but when I try to include the image in a xslt view using the following line :

<xforms:output mediatype="image/*"  value="translate(xxforms:call-xpl('oxf:/is/finance/jpg.xpl', (), (), ('data'))/text(), ' ','')"/>

the image is broken... I've try this but... The image is always broken...

<xforms:output mediatype="image/*"  value="translate(xxforms:call-xpl('oxf:/is/finance/jpg.xpl', (), (), ('data'))/*/text(), ' ','')"/>

Do you see what I'm doing wrong?

If it can help, here is the java code where I send the image to the contentHandler :

...
atts.addAttribute("http://www.w3.org/2001/XMLSchema-instance", "type", "xsi:type", ContentHandlerHelper.CDATA, "xs:base64Binary");
atts.addAttribute("", "content-type", "content-type", ContentHandlerHelper.CDATA, "image/jpeg");
            contentHandler.startPrefixMapping("xs",
                    "http://www.w3.org/2001/XMLSchema");
            contentHandler.startDocument();
            contentHandler.startElement("", "document", "document", atts);
            contentHandler.characters(tab2, 0, tab2.length);
            contentHandler.endElement("", "document", "document");
            contentHandler.endPrefixMapping("xs");
            contentHandler.endDocument();



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Problem with <xforms:output mediatype="image/jpeg" value="..."/>

Alessandro Vernet
Administrator
Hi Frédéric,

What if you remove the mediatype attribute on the <xforms:output>: is
the path to the image right? Can you load the image from that path in
your browser?

If it is the right path, putting back the mediatype attribute, can you
look at the source HTML that gets generated? Do you see anything wrong
there?

Alex

On 2/1/07, Frédéric Blanc <[hidden email]> wrote:

>
>  Hi,
>
>  I want to generate an image via the jpg.xpl and display the result in a
> xslt view. The image is correctly generate (if I forward the output of
> jpg.xpl to an html-serializer, the browser display the image correctly) but
> when I try to include the image in a xslt view using the following line :
>
>  <xforms:output mediatype="image/*"
> value="translate(xxforms:call-xpl('oxf:/is/finance/jpg.xpl',
> (), (), ('data'))/text(), ' ','')"/>
>
>  the image is broken... I've try this but... The image is always broken...
>
>  <xforms:output mediatype="image/*"
> value="translate(xxforms:call-xpl('oxf:/is/finance/jpg.xpl',
> (), (), ('data'))/*/text(), ' ','')"/>
>
>  Do you see what I'm doing wrong?
>
>  If it can help, here is the java code where I send the image to the
> contentHandler :
>
>  ...
> atts.addAttribute("http://www.w3.org/2001/XMLSchema-instance",
> "type", "xsi:type", ContentHandlerHelper.CDATA, "xs:base64Binary");
>  atts.addAttribute("", "content-type", "content-type",
> ContentHandlerHelper.CDATA, "image/jpeg");
>              contentHandler.startPrefixMapping("xs",
>                      "http://www.w3.org/2001/XMLSchema");
>              contentHandler.startDocument();
>              contentHandler.startElement("", "document", "document", atts);
>              contentHandler.characters(tab2, 0, tab2.length);
>              contentHandler.endElement("", "document", "document");
>              contentHandler.endPrefixMapping("xs");
>              contentHandler.endDocument();
>
>
>
> --
> You receive this message as a subscriber of the [hidden email]
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>

--
Orbeon Forms - Web Forms for the Enterprise, Done the Right Way
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Problem with <xforms:output mediatype="image/jpeg" value="..."/>

f.blanc
In reply to this post by f.blanc
I didn't notice that the value attribute had to be double-quoted *and* single-quotes if it is a path to the file -_-'

value="'file.jpg'"

It's working very well now ^^

Thank you for your reply

HAve a nice day



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws