Mark Wilson I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :
03/24/2008
Times viewed :
663
Xalan: The javax.xml.transform.sax.TemplatesHandler Class
This
class is a SAX ContentHandler that may be used to process SAX parse events
(parsing transformation instructions) into a Templates object. This is the
alternate way of getting compiled stylesheets. In my other transformation
related tutorial, I have used the raw stylesheet( passed uri of stylesheet to
the transform() method to perform transformation). This class provided
alternate way of parsing the stylesheet and converting the stylesheet into
Templates object.
This is
class provides mechanism of how to get Templates object. So user can control
any error that might occur during parsing mechanism. If any error occurs no
further processing can be done so utilization of resources can be utilized
properly.
Method Overviews
I will
covering here, how to get Templates object from a stylesheet. When a
TemplatesHandler object is used as a ContentHandler for the parsing of
transformation instructions, it creates a Templates object, which the caller
can get once the SAX events have been completed.
Example of getTemplates():
getTemplates() is used to get javax.xml.transform.Templates object.