cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <>
Subject RE: do not quote!
Date Fri, 07 Jul 2000 18:03:45 GMT
At 10:12 +0200 06/07/00, Torsten Curdt wrote:

>Hm... so there's no way of returning something that goes back into
>the XML parsing process?! :-(

This is what took me a long time to understand.

Your XML file that has TagLibs or logic in it, only gets Parsed when it

The output of your XML/Logicsheet transformation is Java Code that executes
when someone asks for the page. If you never modify your XML again, it is
never referred to again.

I think of it this way:
Anything inside <xsp:logic> goes verbatim into building the Java Code of
your producer, including instructions for making the Tags in your XML that
your logicsheet does not catch. Any "XSL logic" built into your logicsheet
is adjusting how that source code gets written.

Anything inside <xsp:expr> tags is treated as a Null, String, Node or
Node[], and is Cloned into the output Document.

>> I believe what you want to do is return a Node object and include it using
>> <xsp:logic> and the xspCurrentNode object:
>Well, I want to add some child nodes to the current node
>and -if possible- let cocoon do the parsing job!
>But now I fear the parsing has already happened at that time...

I believe so, yes.

>> <xsl:template match="listing">
>>     <xsp:logic>
>>         xspCurrentNode.appendChild(getResult(document));
>>     </xsp:logic>
>>     <xsl:apply-templates/>
>> <xsl:templates>
>> Note that you either have to create the Node using the same
>> document element
>> (that's why the method is passed the document object) or use the
>> XSPUtils.cloneNode() method.
>Hm.. why should I pass the document object to my method?!
>What is the parameter of appendChild ?

If you are going to create DOM objects to add to your output, you either
need to create them belonging to the output Document object, or Clone your
DOM objects into the Output Document. Hence the possible need to pass the
Document object to your code.

>> Of course, you could parse the String that is
>> returned, but that would be substatialy slower.
>Any idea how I can include external xml data as fast
>as possible ?! (maybe passing a tree instead of a string
>and add a complete subtree instead of each child?!)

I don't know which is the fastest, but you have several options.
XInclude, external entities, and soon my new TagLib :)

Hope this helps

regards Jeremy

   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <>     		 <>
    <phone:+44.[0].20.7737.6831>        <>

View raw message