Hallo,
I tried the following for a stylesheet simple.xsl
---------------------------------------------------------------------
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsp="http://www.apache.org/1999/XSP/Core"
version="1.0"
>
<xsl:template match="article">
<xsl:apply-templates select="para"/>
</xsl:template>
<xsl:template match="para">
<xsl:apply-templates select="@*|node()"/>
</xsl:template>
<xsl:template match="date">
<xsp:expr>
SimpleDateFormat.getInstance().format(new Date(), "hh:mm:ss")
</xsp:expr>
</xsl:template>
...
</xsl:stylesheet>
---------------------------------------------------------------------
but the result is always
---------------------------------------------------------------------
Hello, today is
<xsp:expr>
SimpleDateFormat.getInstance().format(new Date(), "hh:mm:ss")
</xsp:expr>
---------------------------------------------------------------------
cocoon does not process the xp:expr tag, it is just outputted as plain text.
Do I need an addtionial transformer for xtp, so that the xsl is parsed
before
beeing processed? Can you give me a short example for mapping ?
I tried the following inside sidemap.xmap :
---------------------------------------------------------------------
<map:generate src="docs/samples/simple.xml"/>
<map:transform src="stylesheets/page/simple.xsl"/>
<map:serialize type="html"/>
---------------------------------------------------------------------
What I found was a short introduction at
http://www.infozone-group.org/schemoxDocs/html/ctwo.html#Na74cfa5f
Do you think, this is the right starting point?
Thanks,
Andreas Bednarz
education-one GmbH
----- Original Message -----
From: "giacomo" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 12, 2002 10:31 PM
Subject: Re: Need for short assistance
> On Tue, 12 Feb 2002, Bednarz, education-one GmbH wrote:
>
> > Hello!
> >
> > I am experienced to XML, XSL, JSP & JSP Taglibs but do not have the
right
> > overview of cocoon 2. I need some help or advise how to implement the
> > following idea:
> >
> > I would like to put a simple xml file with the following content
(nothing
> > else) :
> >
> > --- simple.xml ---
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > <article>
> > <para>
> > Hello, today is <date/>
> > </para>
> > <para>
> > You have <subscribers poolnr="1"/> new subscribers!
> > </para>
> > </article>
> >
> >
> > A standard XSL stylesheet should replace <date/> by "Jan 22th 2002" from
a
> > Java statement. The second <subscribers/> should be replaced by Java
code,
> > which looks in a database table and retrives the necessary information.
I
> > know how to handle this problem easilly with JSP & Taglibs, but a Cocoon
2
> > solution would meet my future developement plans. Can anyone give me
some
> > hints (do I need pipes?) or even a simmiliar complete example? Is there
some
> > kind of API to develop custom tags or filters which can handle
parameters
> > and body contents?
>
> You should look for XSP and Logicsheets in the docs.
>
> Giacomo
>
>
> ---------------------------------------------------------------------
> 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]>