there is no such thing as a SAX tree, if it is a tree it is a DOM tree. SAX is an interface that generates event streams, like when you parse a xml file with sax the sax parser would fire events like startDocument(), startElement(), endElement(), endDocument() in a succession of function calls.
DOM creates a tree of nodes much like an unbalanced b-tree where every node represents a element, atrribute and visa versa. DOM is then again mosty buildt up by a SAX parser, because you could taje the events from the SAX parser and create the corresponding nodes when the event functions tells you so. the javax.xml.transform.sax.SAXSource is junction between thes two ways of processing xml because a SAXSource could be a stream of ascii(javax.xml.transform.stream.StreamSource), a stream of SAX events (javax.xml.transform.sax.SAXSource) or a DOM tree javax.xml.transform.dom.DOMSource. all of these can be a javax.xml.transform.Source to create SAX events which is what cocoon2 likes to eat. Cocoon2s generators are in general just routines that creates SAX events from various sources. if you have a Document object in memory, you can pass it to cocoon2 through "DOMStreamer", a utility class in cocoon2 that generates SAX events from a DOM source. to make a long story short, DOM is xml nodes in memory as nodes in a b-tree, while SAX is just function events that pass by a api and never leaves anything in memory, SAX leaves the responsability of creating memory objects if required to the SAX Handler. hope this helped a bit! :-) mvh karl øie -----Original Message----- From: Søren Neigaard [mailto:[EMAIL PROTECTED]] Sent: 13. november 2001 20:30 To: [EMAIL PROTECTED] Subject: SAX tree? This subject is a little offtopic :) Ok I will try to return a SAX tree to C2 instead of a stream of XML. I found the following link that talks about this: http://www.aoindustries.com/docs/cocoon-1.8.2/faqs.html#faq-xspinsertxml Now I'm not a XML shark, so I could need some help doing this. I guess I will be using this API to create a SAX tree: http://java.sun.com/xml/jaxp/dist/1.1/docs/api/, but what object should I return? What is it excactly C2 accepts as input? Is it a "javax.xml.transform.sax.SAXSource"? Please just give a few pointers :) Med venlig hilsen/Best regards Søren Neigaard System Architect ................................ Mobilethink A/S Arosgaarden Åboulevarden 23, 5.sal DK - 8000 Århus C Telefon: +45 86207800 Direct: +45 86207810 Fax: +45 86207801 Email: [EMAIL PROTECTED] Web: www.mobilethink.dk ................................ --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faqs.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]> --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faqs.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>