[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: image from a jar file

Subject: Re: image from a jar file
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 21 Aug 2008 20:08:17 -0400
Re:  image from a jar file
At 2008-08-22 01:55 +0200, Rolf Schumacher wrote:
Mauritz Jeanson wrote:
> Something like this:
>
> <fo:external-graphic src="jar:file:///foo/bar.jar!/baz/logo.jpg"/>
>
> See http://java.sun.com/javase/6/docs/api/java/net/JarURLConnection.html
>
Yes, it works that way. Thank you, Mauritz.

Note there are rules for src= attributes in XSL-FO that, while not being enforced by all XSL-FO engines, should be followed for portability with engines that do enforce the syntax specified in the standard:


src='url("jar:file:///foo/bar.jar!/baz/logo.jpg")'

Note that while url(...) and url('...') are also allowed, RFC 2396 allows the single quote and parentheses in URI strings, and XML documents are authored with arbitrary values unexpected by stylesheet writers. I tell my students the stylesheet writer should use double quotes as above to "protect" their value specification from a user value that might disturb the delimiters chosen.

If you *really* want to use double quotes for your attribute literal then you can do:

src="url(&quot;jar:file:///foo/bar.jar!/baz/logo.jpg&quot)"

I hope this helps.

. . . . . . . . . . . Ken

--
Upcoming XSLT/XSL-FO hands-on courses:      Wellington, NZ 2009-01
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.