You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Joerg Heinicke <jo...@gmx.de> on 2007/12/16 01:52:01 UTC

Re: RE : Does CInclude/Include transformers buffer incoming documents ?

On 15.12.2007 19:35 Uhr, Boisvert, Eric wrote:

> I agree in principle, this is how cocoon works, in theory. But, for
> example, as soon as one puts an XSLT transformer in the pipeline, the
> document is indeed read completly in memory (in a DOM structure) simply
> because XSLT (XPath) allows to reference any part of the document -
> which force the whole document to buffered in memory prior to execute XSLT.

That's not quite true. Yes, you can write XSLT in a bad way (using 
XPaths starting with double slash for example), which indeed forces the 
whole document to be loaded. But if you write it in a good way the XSLT 
processors have some optimizations to only load the most necessary parts 
of the document.

> Now I'm redesigning the architecture and exploring the idea of using
> Cinclude to dispatch WFS queries and I was afraid Cinclude was
> 'buffering' the document in memory

 From the implementation of the CIncludeTransformer: It uses SAX to 
stream through the included documents - except when you use the select 
attribute. Then it creates a DOM and executes the select on it.

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Cocoon 2.2 - Symbolic links in map:mount path not working

Posted by Hugh Sparks <hu...@csparks.com>.
I have a test case sitemap that simply mounts a sub-sitemap:

    <map:match pattern="*/**">
            <map:mount src="{1}/" uri-prefix="{1}"/>
    </map:match>

The cocoon webapp has this root directory:

    WEB-INF
    sitemap.xmap
    stuff

Stuff is a directory that contains:

    sitemap.xmap
    index.html

The stuff/sitemap.xmap simply does a
map:read on the index.html file.

This configuration works as expected when "stuff" is a
directory, but if I introduce asymbolic link, "thing" :

    ln -s stuff thing

I get this error:

    http-8080-1 ERROR cocoon.access - Internal Cocoon
    Problem org.apache.cocoon.ProcessingException:
    Sitemap: error when calling sub-sitemap at
    <map:mount> - jndi:/localhost/cocoon22//sitemap.xmap:8:43
    at <map:match> - jndi:/localhost/cocoon22//sitemap.xmap:7:28
    at org.apache.cocoon.ProcessingException.throwLocated
        (ProcessingException.java:111)
    at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke
        (MountNode.java:118)
    ...

Note the empty path element in the jndi path where
"thing" might be expected.

I have both cocoon 1.1 and cocoon 2.2 installations running
under Tomcat 6.x. When I move the "stuff" directory to the
cocoon 1.1 webapp, the example works as expected.

Is there some property I should set to enable symbolic links
as path components in cocoon 2.2?

Thanks,

-Hugh Sparks, hugh@csparks.com






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: RE : RE : Does CInclude/Include transformers buffer incoming documents ?

Posted by Joerg Heinicke <jo...@gmx.de>.
On 15.12.2007 20:05 Uhr, Boisvert, Eric wrote:

>> That's not quite true. Yes, you can write XSLT in a bad way (using
>> XPaths starting with double slash for example), which indeed forces the
>> whole document to be loaded. 
>  
> Well.. I stand corrected. Thank you for this information.  So the XSLT engine is smart enough to analyse the stylesheet and load a subset of the document (I'm impressed)

You can read at http://wiki.apache.org/cocoon/NoMoreDtmIdError for an 
example where changing the XSLT fixed such an issue.

>> It uses SAX to stream through the included documents 
> 
> ok. but is the thing buffered (as a character buffer) in memory before being parsed ?

 From what I understand it is not by default. Only in case of using 
cached-include element instead of just the include element the stream is 
cached. So you really should be fine with it.

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE : RE : Does CInclude/Include transformers buffer incoming documents ?

Posted by "Boisvert, Eric" <eb...@nrcan.gc.ca>.
>That's not quite true. Yes, you can write XSLT in a bad way (using
>XPaths starting with double slash for example), which indeed forces the
>whole document to be loaded. 
 
Well.. I stand corrected. Thank you for this information.  So the XSLT engine is smart enough to analyse the stylesheet and load a subset of the document (I'm impressed)
 
> It uses SAX to stream through the included documents 

ok. but is the thing buffered (as a character buffer) in memory before being parsed ?
 
thanks, and sorry for persistent questionning
 
Eric
 
 
________________________________

De: Joerg Heinicke [mailto:joerg.heinicke@gmx.de]
Date: sam. 2007-12-15 19:52
À: users@cocoon.apache.org
Objet : Re: RE : Does CInclude/Include transformers buffer incoming documents ?



On 15.12.2007 19:35 Uhr, Boisvert, Eric wrote:

> I agree in principle, this is how cocoon works, in theory. But, for
> example, as soon as one puts an XSLT transformer in the pipeline, the
> document is indeed read completly in memory (in a DOM structure) simply
> because XSLT (XPath) allows to reference any part of the document -
> which force the whole document to buffered in memory prior to execute XSLT.

That's not quite true. Yes, you can write XSLT in a bad way (using
XPaths starting with double slash for example), which indeed forces the
whole document to be loaded. But if you write it in a good way the XSLT
processors have some optimizations to only load the most necessary parts
of the document.

> Now I'm redesigning the architecture and exploring the idea of using
> Cinclude to dispatch WFS queries and I was afraid Cinclude was
> 'buffering' the document in memory

 From the implementation of the CIncludeTransformer: It uses SAX to
stream through the included documents - except when you use the select
attribute. Then it creates a DOM and executes the select on it.

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org