You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Bednarz, education-one GmbH" <an...@education-one.de> on 2002/02/12 22:50:41 UTC
Allready looked in XSP and Logicsheets
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" <gi...@apache.org>
To: <co...@xml.apache.org>
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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
>
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: Allready looked in XSP and Logicsheets
Posted by Brandon Rich <br...@trainix.com>.
You might want to take a look at the sitemap in the sub/ directory.
Here's the part to look at:
<!-- Dynamic XSL -->
<map:match pattern="xsl-dynamic-source">
<map:generate type="serverpages"
src="stylesheets/simple-page2html.xsp"/>
<map:serialize type="xml"/>
</map:match>
<map:match pattern="xsl-dynamic">
<map:generate src="docs/simple.xml"/>
<map:transform src="cocoon:/xsl-dynamic-source"/>
<map:serialize/>
</map:match>
On Tue, 2002-02-12 at 16:50, Bednarz, education-one GmbH wrote:
> 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" <gi...@apache.org>
> To: <co...@xml.apache.org>
> 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: <co...@xml.apache.org>
> > For additional commands, e-mail: <co...@xml.apache.org>
> >
> >
>
>
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
--
Brandon Rich <br...@trainix.com>
Trainix, Inc. - "Teaching Tomorrow, Today!"
www.trainix.com
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: Allready looked in XSP and Logicsheets
Posted by Andre Thenot <at...@thenot.net>.
On Tuesday, February 12, 2002, at 04:50 , Bednarz, education-one
GmbH wrote:
> 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"
>>
>>
Try replacing:
xmlns:xsp="http://www.apache.org/1999/XSP/Core"
with:
xmlns:xsp="http://apache.org/xsp"
Andre.
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
RE: Allready looked in XSP and Logicsheets
Posted by Sean Malone <ma...@indigo.ie>.
In the sitemap the generator should be of type="serverpages"
<map:match pattern="*.xsp">
<map:generate type="serverpages" src="{1}.xsp"/>
This can then be transormed after the xsp part has been processed
<map:transform src="{1}.xsl"/>
-----Original Message-----
From: Bednarz, education-one GmbH
[mailto:andreas.bednarz@education-one.de]
Sent: 12 February 2002 21:51
To: cocoon-users@xml.apache.org
Cc: giacomo@apache.org
Subject: Allready looked in XSP and Logicsheets
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" <gi...@apache.org>
To: <co...@xml.apache.org>
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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
>
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>