xsl-list
[Top] [All Lists]

RE: [xsl] Curious about creating a custom function to java classes pertaining to images

2009-08-07 07:35:39
Thanks Michael and Wendell for your input.

I'm still a beginner when it comes to Java and was looking at this as part of a 
learning process. I like Wendell's method and have been interested in Cocoon 
for some time and your method is giving me incentive to look at it and give it 
a try also.

Thanks again

Marijan (Mario) Madunic
Publishing Specialist
New Flyer Industries
(204) 934 8815
mario_madunic(_at_)newflyer(_dot_)com

-----Original Message-----
From: Wendell Piez [mailto:wapiez(_at_)mulberrytech(_dot_)com] 
Sent: Thursday, August 06, 2009 3:37 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Curious about creating a custom function to java classes 
pertaining to images

Mario,

At 09:31 AM 8/6/2009, you wrote:
Sorry about the foggy subject line and if this 
isn’t appropriate for this mailing list.

Was sitting here thinking about our various 
image needs and was thinking about the 
possibility of creating a custom function that 
calls a Java class. Here is what I’m thinking about:

Parse XML doc (DITA) using XSLT 2 and Saxon.
Come across a ref to an image (which we 
haven’t decided if we create a specialized 
concept to contain all relevant image info or some other method).
The original images will be SVG more than likely, at the moment they are WMF.
Parse the SVG to create the appropriate file 
type (jpg, gif, wmf, etc, or just plain old SVG) 
for output type, resize (based on conditions), 
place the modified image in the appropriate 
dir/db table. All this using XSLT via either a 
call to Java class or a custom XSLT function calling a Java class.

I’d like this to be part of the XSLT publishing workflow.

Has anyone done this or see any issues of doing 
this? Just wanted a heads up before going further with this.

This doesn't sound unreasonable.

What I do is quite similar. I use Apache Cocoon, 
which allows me to look up and load SVG files, 
rasterize them into jpeg or PNG (using Apache 
Batik, which comes with Cocoon), and rescale 
them, when necessary, while doing so (using XSLT).

The reference to the file is either a direct call 
to the server where Cocoon is running, or by 
means of a key which is expanded by XSLT into such a link.

Essentially, this does everything you describe, 
except I use Cocoon instead of writing the Java 
myself, plus it's RESTful, using calls on a 
(local) web server instead of extension 
functions. You could certainly emulate this 
functionality in Java, using components you 
either acquired (from Cocoon or elsewhere) or wrote yourself.

Cheers,
Wendell


======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
   Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--------------------------------------------------------------------
Please consider the environment before printing this e-mail.

CONFIDENTIALITY STATEMENT: This communication (and  any and all information or 
material transmitted with this communication) is confidential, may be 
privileged and is intended only for the use of the intended recipient. If you 
are not the intended recipient, any review, retransmission, circulation, 
distribution, reproduction, conversion to hard copy, copying or other use of 
this communication, information or material is strictly prohibited and may be 
illegal. If you received this communication in error or if it is forwarded to 
you without the express authorization of New Flyer, please notify us 
immediately by telephone or by return email and permanently delete the 
communication, information and material from any computer, disk drive, diskette 
or other storage device or media. Thank you.


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--