-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Templates for doing XSLT transformations #67
Comments
Thanks for creating this issue. Should this approach find its way into Yanel, it would make sense to also implement a control flag that one can override for its realm, e.g. so that if "default" is set, the algorithm is used as today, if "templates" is set, the new algorithm is used (the flag would be read at startup of the realm). |
This is a short update on how I introduced XSL Template objects (and caching) into my realm. Performance has been improved dramatically in our case, up to 10 times faster than the current Yanel implementation. BasicXMLResource.getTransformedInputStream() I replaced this line by In the same class I added this protected method:
So the change above actually does not change anything at all, except that now it is possible to overwrite the A new class extending BasicXmlResource with caching capabilities
As you can see, if caching is enabled (you have to implement it at your own, on resource level or globally), it uses the The Templates Cache Class
The usage of
Final remarks If you use the cached templates as described above, you will get the following behaviour:
|
Dear Balz Great :-), thanks very much. Will try to integrate it shortly. All the best Michael Am 10.04.14 15:34, schrieb baszero:
|
I see that this has still not found its way into Yanel... this is really a pity! This template cache is really boosting a Yanel App very much, if you have really large XSL files. I will send a pull request, hoping that it will find its way into yanel. For the moment I will just overwrite the BasicXMLResource.java in my realm. |
backwards compatible). - new class XslTemplatesCache with high performance cache - How to use the cache: extend BasicXMLResource and overwrite the method getTransformerHandler() - Example for how to use Cache: wyona#67 (comment)
Please close this issue and just process this pull request: #77 |
The class
src/impl/java/org/wyona/yanel/impl/resources/BasicXMLResource.java
is currently re-parsing XSLTs with every request. In order to improve performance it probably would make sense to use javax.xml.transform.Templates
See for example
http://www.javaworld.com/article/2073394/java-xml/transparently-cache-xsl-transformations-with-jaxp.html
The text was updated successfully, but these errors were encountered: