cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giacomo Pati <Giacomo.P...@pwr.ch>
Subject Re: XSP confusion
Date Thu, 25 May 2000 20:35:23 GMT
Mike Engelhart wrote:
> 
> Hi all -
> 
> Ricardo's announcement that the XSP engine in Cocoon 2 is DOM based while
> the rest of Cocoon 2 is SAX based has left me with some design questions.  I
> was planning on making all the code in my application use XML directly
> (either DOM or SAX depending on what Cocoon 2 was going to use which I
> assumed was SAX) rather than using XSP to generate the XML from existing
> Java objects (e.g., iterating through a ResultSet or ArrayList, etc).
> It seems from a performance standpoint, SAX is the way for me to go but does
> this mean that I have to generate DOM objects every time I want to put an
> XML element or fragment into an XSP dynamically?

I understand what Ricardo was saying is that the process of generating
the java code from a XSP page is done using DOM. The compiled java class
is in fact a generator which emits SAX events. As long as you use "pure"
XSP you don't have to worry if it's DOM or SAX.

If you use XSP internal stuff like:

	xspCurrentNode.appendChild(document.importNode(domElement, true));

you're in trouble because in Cocoon 2 it will be something like 

	xspAttr.clear();
	this.contentHandler.startElement("", "p", "p", xspAttr);
	this.characters("I'm a logicsheet-generated text!");
	this.contentHandler.endElement("", "p", "p");

Giacomo

-- 
PWR GmbH, Organisation & Entwicklung      Tel:   +41 (0)1 856 2202
Giacomo Pati, CTO/CEO                     Fax:   +41 (0)1 856 2201
Hintereichenstrasse 7                     Mailto:Giacomo.Pati@pwr.ch
CH-8166 Niederweningen                    Web:   http://www.pwr.ch

Mime
View raw message