• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Convert XSLT Template to XSLT String object

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,

1. I am working in enhancement project. Our project extensively used XSLT transformation. The XSLT is stored in oracle database & then using it. TO avoid querying DB everything, we implemented Cache mechanism. When the server starts up, a thread will keep on fetching the XSLT from database and converting them into Templates then added in the HashMap defined in Singleton class. Whenever we require, we will take the Template from hashmap and convert one XML to another....
2. Now, we have one more enhancement that we need to give the XSLT as String object to one URL. As already we implemented caching machanism, we would like to use the same template converting back to String object(contains text of XSLT). Will it possible to get the XSLT from the Template object?

Thanks,
Senthil
 
Ranch Hand
Posts: 688
Mac
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you elaborate more about Template? How your template stores XML.
In java terminology a template means a object which stores XML.
 
V Senthil
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
We are storing XML. Using XSLT we have created javax.xml.tranform.Template object. Using this Template object u will get the Transformer java Object. Again by using Transformer object, we will convert one XMl to another.
Thanks,
senthil
 
V Senthil
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, We r not storing XML in java Template object.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"V",
please UseRealWords

thanks,
Dave
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As far as I can tell from the JavaDocs, there is no way to regenerate the original form of a XSLT from an object that implements the javax.xml.transform.Templates interface. Why don't you just cache the original String in addition to the Templates object?
Bill
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,

1. I am working in enhancement project. Our project extensively used XSLT transformation. The XSLT is stored in oracle database & then using it. TO avoid querying DB everything, we implemented Cache mechanism. When the server starts up, a thread will keep on fetching the XSLT from database and converting them into Templates then added in the HashMap defined in Singleton class. Whenever we require, we will take the Template from hashmap and convert one XML to another....
Thanks,
Senthil[/QB]

Senthil,

I am working on a similar project where in xsl performance improvement is major concern.The current implementaion uses xalan xslt processor. Original plan is to replace xalan interpretive processor with xsltc ( compile style sheet once and use translets for transform thereon..). It dit not work because current implementaion makes extensive use of xalan:evalaute() library function which is not supported bt xsltc. ANY HELP ..ANY WORK AROUND TO THIS WOULD BE HIGHLY APPRECIATED..
alternately looking at caching Templates objects and use them for transformations. can any one throw some light on Template caching mechanism.

I have around 250 xsl files, will it be wise to cache 250 Templates in JVM memory? Any inputs on this.
If some one has sample Template Cache code, please send me for my use.

senthil, can you share your experiences ? Since you have already worked in similar lines , your help would be of great relief for me.

waiting to hear from you,
Amru
 
incandescent light gives off an efficient form of heat. You must be THIS smart to ride this ride. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic