cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <gree...@hotmail.com>
Subject Re: Newbie: DOM -XSL-> markup?
Date Tue, 02 May 2000 11:26:29 GMT
morten@itu.dk wrote:
>All the information I\'ve found on XML/DOM/XSL etc
>is rather focused on applying XSL on XML files.

XML entities in Cocoon do not have to be actual "files" on a disc. They can 
be entirely generated at request time, for example. The word "files" is just 
used as a figure of speech.

>Is there a way to control XSL in my \'object space\'?
>What I want to do, is generate a DOM object on
>the basis of IMAP data, apply client dependant
>XSL to that, and output a valid markup (eg. WML/HTML).
>The XML technologies are new to me, so if this
>doesn\'t make sense, please correct me:
>Can I construct a DOM object in memory, instantiate
>some \'XSL object\' from an XSL file and somehow
>generate/restrict output based on that?

Sure, this is precisely what Cocoon does! Write either a Producer or an XSP 
page to construct the DOM object (XSP will be probably be easier and more 
maintainable), and return it from the getDocument methods (this is done 
automatically with XSP, you don't need to do anything). Put processing 
instructions in the DOM to specify the stylesheet and formatters to be used, 
and Cocoon will do the rest. See the javadocs for 
org.apache.cocoon.producer.Producer (no typo).

However, be warned - DOM will not be used in Cocoon 2, SAX will because it's 
faster.

>Pointers to info relevant to this topic is greatly
>appreciated, thanks.
>

The xml.apache.org webserver is not responding right now (connection 
refused) but you should have all the docs you need under docs javadocs or 
build/docs in your cocoon directory.


--
Robin

270+ Open Source Java links! 
http://directory.mozilla.org/Computers/Programming/Languages/Java/Open_Source/

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


Mime
View raw message