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

RE: XSLT File I/O?

Subject: RE: XSLT File I/O?
From: "Andrew Welch" <ajwelch@xxxxxxxxxxxxxxx>
Date: Thu, 17 Feb 2005 08:14:32 -0000
xslt file exists
> Hi,
> I am doing a bunch of XSL transformations from an XML file
> using Cocoon and finally generate a FO file.
>
> I have the following requirement to carry out in my XSL
> transformations: 1. Get the fileurl for images in the XML
> (e.g. /images/A.jpg) 2. Check for the file on a physical
> location 3. If the file exist then ok, otherwise change the
> file url (/images/A_temp.jpg).
>
> I have not used File I/O using XSL and am not even sure if
> that's possible.
> Can someone please throw some light on this ?
> Is it possible to fulfill the above requirement using XSL?
> Are there any other ways to do this using Cocoon?

If it's possible (I don't know anything about Cocoon) I would write an
XMLFilter that would sit between the XML parser and the transformation.
As the SAX events come through you could check the img/@src to see if
the file exists, and then add a custom attribute 'exists="true"' to the
element (well, to the Attributes object that goes in the call to
super.startElement()).  Then all you need to do is check for the @exists
attribute in your stylesheet.

cheers
andrew

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.