You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by O....@sh.cvut.cz on 2004/01/07 04:21:33 UTC
Impossible to use reader as source of XSLT?
Hi,
I have a problem. I want to use transformer, it gets XSL stylesheets not from
filesystem, but from database. As some good mind advised, I used cocoon:/
protocol to call another pipeline with databasereader, which returns
appropriate XSL stylesheet. But cocoon reports: "Streaming of an internal
pipeline is not possible with a reader."
Source fragment of sitemap is here:
<map:match pattern="*/html/*/*/*.html">
<map:generate type="serverpages" src="logic/main.xsp">
<map:parameter name="language" value="{2}"/>
<map:parameter name="format" value="html"/>
<map:parameter name="subweb" value="{1}"/>
<map:parameter name="id" value="{4}"/>
<map:parameter name="content" value="{3}"/>
</map:generate>
<map:transform src="cocoon:/{1}/html/{2}/stylesheet/0"/>
<map:serialize type="html"/>
</map:match>
reader:
-------
<map:match pattern="*/*/*/stylesheet/*">
<map:read type="databasereader" src="{1}" mime-type="text/xml">
<map:parameter name="table" value="subweb s, article a, article_version v,
article_version_format avf, format f, language l"/>
<map:parameter name="image" value="v.body"/>
<map:parameter name="key" value="s.name"/>
<map:parameter name="where" value="s.stylesheet=a.id and a.id=v.article and
v.id=avf.article_version and avf.format=f.id and f.name='{2}' and
v.language=l.id and l.name='{3}'"/>
</map:read>
</map:match>
What I'm doing wrong? Thanks for answer!
Otmar Vobejda
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Impossible to use reader as source of XSLT?
Posted by Christian Haul <ha...@informatik.tu-darmstadt.de>.
O.Vobejda@sh.cvut.cz wrote:
> Hi,
>
> I have a problem. I want to use transformer, it gets XSL stylesheets not from
> filesystem, but from database. As some good mind advised, I used cocoon:/
> protocol to call another pipeline with databasereader, which returns
> appropriate XSL stylesheet. But cocoon reports: "Streaming of an internal
> pipeline is not possible with a reader."
OK, I was afraid that this will happen.
I see basically three options:
a) try the blob source instead of the cocoon one. See javadocs on
BlobSource and BlobSourceFactory from the databases block for details.
b)You might do the trick using eg XSP (+ esql logicsheet) to retrieve
the stylesheet. However, IIRC you
will need to enclose the output with a tag otherwise the XSP will not
work correctly, so you will need to filter out this additional root tag.
c) write your own source / generator
Chris.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org