andries Posted September 24, 2010 Posted September 24, 2010 (edited) At a customer we had a problem when upgrading from FM10 to FM11 that the export in XML using XSLT became really slow. 3 seconds in FM10 -> 2 minutes in FM11. We found that the issue is not the export, but the post XSLT processing. This is a bug recognized by FileMaker. As a workaround we now export the plain xml, and perform the transformation with ScriptMaster. Maybe this is useful for someone else: /* Adapted by Andries Heylen for ScriptMaster usage BH&A v1.0. 09/2010 info: [email protected] Based on following example: http://www.rgagnon.com/javadetails/java-0407.html This script uses two JARS: - serializer.jar and - Xalan.jar. You can download them from: http://xml.apache.org/xalan-j/ */ import javax.xml.transform.*; import java.io.*; import org.apache.xml.serializer.ExtendedContentHandler; import javax.xml.transform.stream.StreamSource; import javax.xml.transform.stream.StreamResult; //check if xml-file exists if ( new File( _xml ).exists() == false ) { return "xml file not found"; } try { //Instantiate a TransformerFactory who allows to initiate a Transformer object TransformerFactory tF = TransformerFactory.newInstance(); //Initiate the transformer object, define the use of the xslt file Transformer t = tF.newTransformer(new StreamSource(_xslt)); //Transform, the transform method expects the xmlSource and the Output file t.transform( new StreamSource(_xml), new StreamResult(new FileOutputStream(_output)) ); return "Transformation OK"; } catch ( Exception TransformerConfigurationException ){ return "No xslt found"; } catch ( Exception TransformerException ) { return "Transformation failed"; } catch ( Exception e ) { return "Transformation failed"; } Any comments or improvements are welcome! Certainly regarding the exception catching as this is something completely new to me. Edited September 24, 2010 by Guest
comment Posted September 24, 2010 Posted September 24, 2010 We found that the issue is not the export, but the post XSLT processing. This is a bug recognized by FileMaker. Can you provide more details of this bug?
andries Posted September 24, 2010 Author Posted September 24, 2010 When I am back in the office I will post the example file we sent to FileMaker. Run it in FileMaker 10 and you will have a nice word document after 2 seconds, run it in FileMaker 11 and it freezes your complete computer (taking all the resources). When you run the XML export without XSLT it works likes a charm, so it is in the postprocessing where it goes wrong. We reported this bug to FileMaker, and they are able to reproduce the problem, but there is no solution yet. I'll come back to this on Monday.
comment Posted September 24, 2010 Posted September 24, 2010 I will post the example file we sent to FileMaker Please do, because this sounds very strange. Version 11 is actually the first time since XML was first introduced (version 6, 2002) that FMI saw fit to update the Xalan-C processor. That means hundreds of bug fixes and over 30 "major updates". If anything, it should work better than the previous version. there is no solution yet. And it's not likely there ever will be. The last version of Xalan-C was released in 2005.
andries Posted September 25, 2010 Author Posted September 25, 2010 Here is an example file, try to run it with FileMaker 10 and with FileMaker 11. Looking forward to your comments and findings! Andries xslt.fp7.zip
comment Posted September 25, 2010 Posted September 25, 2010 I see what you mean. Before I get into this - did you get any response from ChapSoft? I think they are much more likely to find the problematic part than I am.
andries Posted September 25, 2010 Author Posted September 25, 2010 OK so you think that the reason is the XSLT file created by EZxslt? I will contact them. Thanks!
comment Posted September 25, 2010 Posted September 25, 2010 I think - actually, I know this for sure - that there is something in the stylesheet that causes problems when processed with Xalan-C 1.10 but not with the older version or other processors such as libxslt. I also have a suspicion as to what that something might be. Do you have access to the original template file? Macintosh HD:Users:martine:Desktop:Europro:EFIP_Template.rtf Do you know which platform and application were used to create this file? Perhaps you should try re-saving the file in another application that can open/save rtf files, then run it through EZxslt again.
andries Posted September 26, 2010 Author Posted September 26, 2010 Thanks for the advice. I will take a look at this next week together with my colleague who created the stylesheet. I'll keep you up to date.
Newbies RussKohn Posted August 15, 2012 Newbies Posted August 15, 2012 I just did some testing and found a work-around.. It looks like the XSLT that EZxslt is generating formats the xslt file to make it easier to read for humans by adding some return characters into the output stream. I can run this through Oxygen and other xslt processors without a problem, and through the old FMP Xalan without a problem, but in FMP11 it kinda chokes on it. I removed these characters from the xslt manually using BBEdit (though you can use any text processor you wish), and retested on FMP11 and the output was almost immediate. Here is what you need to do: Look for the following string and replace it with an empty string: The is an escaped return character. The is an escaped end-of-line character. Zap them both everywhere and you should be good to go. I'll add this fix to the list of things I need to do to EZxslt and try to get an update out before too long.
Recommended Posts
This topic is 4551 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now