You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Pavani Mukthipudi <Pa...@Sun.COM> on 2002/06/17 17:27:24 UTC

Re: Xalan implementation/design question

Sam wrote :
> 
> When Xalan reads the XSL file, does it create a DOM from it
> in memory ? How does the processing work ? Especially with
> templates ??
> 
> If I understand it right, it reads the XSL with SAX and creates 
> a memory DOM from it (not the w3c DOM) ... ? 
> 

The stylesheet is parsed by a SAX parser if the input is a SAXSource or 
a StreamSource and events are passed to the StylesheetHandler. If the input 
is a DOMSource, the tree is traversed and the events are passed to the 
StylesheetHandler. So, in any case, the events are passed to the 
Stylesheethandler which inturn passes the events to the appropriate 
element processor which creates a Template object for that element. 
These template objects are similar to W3C DOM nodes but donot implement 
the Node interface of DOM completely. Also, unlike W3C DOM each node is 
assigned an identification number or a document order index. An internal 
DTM is built in the process for faster access of the stylesheet information.

> 
> How does it actually "apply" that to the XML ?
> 

As the XML input is parsed, the transformation is done in the template object's 
execute() method and the events are passed to the ResultTreeHandler which
inturn passes them on either to a Serializer or any other form of output.

HTH
-Pavani

-- 

Pavani Mukthipudi
Sun Microsystems, Inc.

Phone: 91-80-2298989/87390