IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Is it possible to use dataURL scheme in SPS files Options · View
fabiodap
Posted: Tuesday, August 18, 2009 11:11:17 AM
Rank: Member

Joined: 8/28/2007
Posts: 20
Hello,

i'm building an sps file.
I would like to insert an image whose data is included in the XML data file.
HTML provides a special tag for this: http://en.wikipedia.org/wiki/Data_URI_scheme, which permits to store the image data directly in the tag, without the need to reference an external data source (external url).

As i understand this feature cannot be used in StyleVision. It's a pity because FOP has the support for this kind of feature.
If somebody was able to use this kind of tags with StyleVision can he share the knowledge with me, please?

thank you.

Fabio
vlad
Posted: Tuesday, August 18, 2009 11:21:20 AM
Rank: Advanced Member

Joined: 12/13/2005
Posts: 2,856
Location: Mauritius
Fabio,

what is the reason to embed images in HTML and risk incompatibility with older browsers?

Also, FOP has nothing to do with this, because FOP is only used for PDF - not for HTML!
fabiodap
Posted: Tuesday, August 18, 2009 1:45:58 PM
Rank: Member

Joined: 8/28/2007
Posts: 20
vlad wrote:
Fabio,

what is the reason to embed images in HTML and risk incompatibility with older browsers?

Also, FOP has nothing to do with this, because FOP is only used for PDF - not for HTML!


FOP and browser are not an issue, because we transform to PDF and then show the PDF to the user.
Embedding the image would permit us to be completely independent from the filesystem.

We have images in Blob table fields on ORACLE. We would only need to encode them in Base64, create the XML with the data, call the FOP and show the result to user. No filesystem I/O required.

I tried to put the full <img> tag in a CDATA, and then show it as text. But the "<" and ">" are then escaped when shown. Maybe somebody found a way to achieve this result.

greetings,
Fabio
vlad
Posted: Tuesday, August 18, 2009 2:30:13 PM
Rank: Advanced Member

Joined: 12/13/2005
Posts: 2,856
Location: Mauritius
Ok, now I'm completely lost. Do you want to say that you have an issue with embedding an image in your HTML output? In PDF output? In XML input? And if you put an <img> tag with CDATA - what does it all have to do with FOP?
fabiodap
Posted: Wednesday, August 19, 2009 6:59:23 AM
Rank: Member

Joined: 8/28/2007
Posts: 20
vlad wrote:
Ok, now I'm completely lost. Do you want to say that you have an issue with embedding an image in your HTML output? In PDF output? In XML input? And if you put an <img> tag with CDATA - what does it all have to do with FOP?


Let's forget FOP.
I want to build an XML which also includes the image data (using URL data schema) and i want to be able to design a stylesheet over this xml.
I don't want to save images on filesystem.

The question is: is there a way to do this or not?

Is it clear now?

greetz,
Fabio
fabiodap
Posted: Wednesday, August 19, 2009 7:13:49 AM
Rank: Member

Joined: 8/28/2007
Posts: 20
vlad wrote:
Ok, now I'm completely lost. Do you want to say that you have an issue with embedding an image in your HTML output? In PDF output? In XML input? And if you put an <img> tag with CDATA - what does it all have to do with FOP?


Let's forget FOP.
I want to build an XML which also includes the image data (using URL data schema) and i want to be able to design a stylesheet over this xml.
I don't want to save images on filesystem.

The question is: is there a way to do this or not?

Is it clear now?

greetz,
Fabio
vlad
Posted: Wednesday, August 19, 2009 7:27:31 AM
Rank: Advanced Member

Joined: 12/13/2005
Posts: 2,856
Location: Mauritius
Yes, it is clear now. And, no - with current version this won't work. The upcoming v2010 will have a disable-output-escaping possibility, which allows you to pass nodes unchanged, which will probably do what you asked. We have no fix due date for v2010 though.
vlad
Posted: Friday, October 30, 2009 2:01:25 PM
Rank: Advanced Member

Joined: 12/13/2005
Posts: 2,856
Location: Mauritius
v2010 has been released now
fabiodap
Posted: Tuesday, November 3, 2009 10:40:04 AM
Rank: Member

Joined: 8/28/2007
Posts: 20
WOW. It works!

Added this piece of code in my XML file:

<title><![CDATA[<fo:external-graphic
src="url('data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAwAAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFzByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSpa/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJlZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uisF81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PHhhx4dbgYKAAA7')"
height="3cm" width="3cm" />]]></title>

And then mapped this node as an unparsed content in my stylesheet. And when i render with FOP my image is shown.

Great.

Fabio
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.