[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: XSLT File I/O?
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|