BizTalk Utilities CV ,   Jobs ,   Code library  
 
Home Page
XALAN
org.apache.xalan.xsltc.trax.DOM2SAX Class
org.apache.xalan.transformer.XalanProperties Class
org.apache.xalan.transformer.TrAXFilter Class
org.apache.xalan.transformer.TransformerIdentityImpl Class
org.apache.xalan.processor.TransformerFactoryImpl Class
org.apache.xalan.lib.sql.XConnection Class
javax.xml.transform.sax.TemplatesHandler Class
XALAN Getting Started with XSLTC
The Usage of XALAN
Overview of XALAN - Java
<< WCF, WS, SOAP
XHTML >>

By :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 :605

 

Xalan: The org.apache.xalan.xsltc.trax.SmartTransformerFactoryImpl Class

Extends: javax.xml.transform.sax.SAXTransformerFactory

Members

Signature

Public methods

Source

getAssociatedStylesheet(Source source, java.lang.String media, java.lang.String title, java.lang.String charset)

java.lang.Object

getAttribute(java.lang.String name)

ErrorListener

getErrorListener()

boolean

getFeature(java.lang.String name)

URIResolver

getURIResolver()

Templates

newTemplates(Source source)

TemplatesHandler

newTemplatesHandler()

Transformer

newTransformer()

Transformer

newTransformer(Source source)

TransformerHandler

newTransformerHandler()

TransformerHandler

newTransformerHandler(Source src)

TransformerHandler

newTransformerHandler(Templates templates)

XMLFilter

newXMLFilter(Source src)

XMLFilter

newXMLFilter(Templates templates)

void

setAttribute(java.lang.String name, java.lang.Object value)

void

setErrorListener(ErrorListener listener)

void

setURIResolver(URIResolver resolver)

Overview

This class is main implementation of transformer factory that uses an XSLTC transformer for the creation of Templates objects and uses the Xalan processor transformer factory for the creation of Transformer objects.

A Template is the runtime representation of processed transformation instructions.  While using Templates objects, you should ensure the Thread safety.

Method Overviews

This class is the concrete implementation of transformer factory. I have given examples of methods to create Templates object from an input source, how to create a transformer factory to perform the transformation.

Example of newTemplates(javax.xml.transform.Source):

This method is used to create a Templates object from a Source. Javax.xml.transform.Source is an interface so you have to provide a concrete implementation of Source interface. In my example I have used javax.xml.transform.stream.StreamSource.

            StreamSource source = new StreamSource(stylesheetURI);// stylesheetURI is the system URI for your xsl stylesheet.

            Templates templates = smartTransforer.newTemplates(source);

Example of newTransformer(javax.xml.transform.Source):

This method is used to parse a javax.xml.transform.Transformer Object. Using javax.xml.transform.Transformer object, you can do the actual transformation.         

 StreamSource source = new StreamSource(stylesheetURI);// stylesheetURI represents the stylesheet.

Transformer transformer = smartTransforer.newTransformer(source);

StreamSource sourceXML = new StreamSource(xmlURI);// xmlURI represents system URI of your input xml file.

 StreamResult result = new StreamResult(outURI);// outURI represents system URI of the output file.

If you want the result of your transformer to be shown in your command prompt, then you can use System.out  while creating Result.

StreamResult result = new StreamResult(System.out);

transformer.transform(sourceXML,result);

Example of newTransformer():

This method is used to create a Transformer object that copies the input document to the result. Uses the rg.apache.xalan.processor.TransformerFactory.

Transformer transformer = smartTransforer.newTransformer();

Note: Please see the attached source code for implementation details.


Rate this article on a scale of 1 to 10

Your vote :  


 

Recent Jobs

A great opportunity to Digital Vide
here is a greate opportunity as a S
A great opportunity as a Network En
A Greate Opportunituy as a SQL Deve
An immediate job opportunity as a B

View all Jobs (Add yours)
View all CV (Add yours)



Information Online

swimming pool contractor
chicago web site design
reservationless conference calls
Web Hosting
efax
D&g sunglasses
answering service


    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP