You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Erik Severinsen <er...@abnett.no> on 2000/10/13 11:04:25 UTC

Example of included logicsheet

Does anyone know of some examples of using incl. logicsheet?

I didn't find any in the samples directory, and the info on
http://www.suranyami.com/XSPtutorial/index.html is a bit thin.

Thanks

Erik 'Severini' Severinsen :|: ABnett AS :|: Phone/Fax +47 66768600/1
erik@abnett.no  :|: Mobile: +47 91606563


Re: Example of included logicsheet

Posted by Ulrich Mayring <ul...@denic.de>.
Erik Severinsen wrote:
> 
> Does anyone know of some examples of using incl. logicsheet?

Look in your XSLT documentation for xsl:include and xsl:import

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: Example of included logicsheet

Posted by Konstantin Piroumian <KP...@flagship.ru>.
Another example you can find in Cocoon 1.8 samples at:
../cocoon/samples/xsp/

clear-page.xml - pure content
page-xsp.xsl - logicsheet
page-html.xsl - html formatting

Regards,
  Konstantin Piroumian
Email: kpiroumian@flagship.ru

----- Original Message ----- 
From: "Erik Severinsen" <er...@abnett.no>
To: "Cocoon-Users Mailing list (E-mail)" <co...@xml.apache.org>
Sent: 13 ??????? 2000 ?., ??????? 13:04
Subject: Example of included logicsheet


> Does anyone know of some examples of using incl. logicsheet?
> 
> I didn't find any in the samples directory, and the info on
> http://www.suranyami.com/XSPtutorial/index.html is a bit thin.
> 
> Thanks
> 
> Erik 'Severini' Severinsen :|: ABnett AS :|: Phone/Fax +47 66768600/1
> erik@abnett.no  :|: Mobile: +47 91606563
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 


TYPO Re: Example of included logicsheet

Posted by Michael Bierenfeld <mi...@atmiralis.de>.
Hi,

sorry typo int html.xsl

Inside the page it should mean

  <xsl:apply-templates select="head"/>

  <xsl:apply-templates select="body"/>

	AND NOT

>   <xsl:apply-templates name="head"/>
> 
>   <xsl:apply-templates name="body"/>

Sh.. happens.

Have fun

Michael

Re: Example of included logicsheet

Posted by Michael Bierenfeld <mi...@atmiralis.de>.
Erik Severinsen wrote:
> 
> This is not my idea of using xsp/xsl/xml, I've taken this from David Perry's
> XSP tutorial found at http://www.suranyami.com/XSPtutorial/index.html
> 
> Erik Severinsen :|: ABnett AS :|: Phone/Fax +47 66768600/1
> erik@abnett.no  :|: Mobile: +47 91606563
> 

Right now I got you ;-). I think its the normal
way of using xsp. Personally I dont like the
approach of mixing content and logic. Like it is
explained in the samples. 

Giving you an example is quite a complex thing OK
here we are :

page.xml :

**************CUT HERE *************************
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- the previous line must be first -->
<?xml-stylesheet href="logic.xsl"
type="text/xsl"?>
<?cocoon-process type="xslt"?>

<page stylesheet="html.xsl">
	
	<body>
	Hello I am touched <counter> times
	<body>

</page>
*************CUT HERE ***************************

this is processed by logic.xsl :

*************CUT HERE ***************************
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsp="http://www.apache.org/1999/XSP/Core"
xmlns:response="http://www.apache.org/1999/XSP/Response">
<xsl:template match="page">
    <xsl:processing-instruction
name="cocoon-process">
	type="xsp"
    </xsl:processing-instruction>
    <xsl:processing-instruction
name="cocoon-process">
	type="xslt"
    </xsl:processing-instruction>
    <xsl:processing-instruction
name="xml-stylesheet">
	href=<xsl:text>"</xsl:text><xsl:value-of
select="@stylesheet"/><xsl:text>"</xsl:text>
	type="text/xsl"
    </xsl:processing-instruction>

    <xsp:page>

	<xsp:logic>

		static private int counter = 0;
		private synchronized int counter () {

			int retValue = counter ++;

			return retValue;
		}
	</xsp:logic>

	<xsl:copy>
		<xsl:apply-templates select="@*|node ()"/>
	</xsl:copy>

    </xsp:page>
</xsl:template>

<xsl:template match="counter">

	<xsp:expr> counter () </xsp:expr>

</xsl:template>
**************** CUT HERE ***********************

And finally the xsl that is responsible to
generate html output. Remark this is specified
"somewhat dynymically" in page.xml. So each
"content" Page can have its own LayoutStylesheet !

html.xsl :

**************** CUT HERE ***********************
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="page">

	<xsl:processing-instruction name="cocoon-format">
		type="text/html"
	</xsl:processing-instruction>

	<!-- Hier wird das Seitenlayout festgelegt -->
  	<html>
   	<head>

		<xsl:apply-templates name="head"/>

    	</head>

	<body>
		<xsl:apply-templates name="body"/>

	</body>

	</html>

</xsl:template>

<xsl:template match="head">

	<xsl:apply-templates/>

</xsl:template>

<xsl:template match="body">

	<xsl:apply-templates/>

</xsl:template>
**************** CUT HERE ***********************

Uff. Hope this helps. So content, logic and layout
are handled in 3 different files. The tasks are
clearly seperated from each other.

Regards

Michael

RE: Example of included logicsheet

Posted by Erik Severinsen <er...@abnett.no>.
This is not my idea of using xsp/xsl/xml, I've taken this from David Perry's
XSP tutorial found at http://www.suranyami.com/XSPtutorial/index.html

Erik Severinsen :|: ABnett AS :|: Phone/Fax +47 66768600/1
erik@abnett.no  :|: Mobile: +47 91606563


> -----Original Message-----
> From: michael@atmiralis.de [mailto:michael@atmiralis.de]On Behalf Of
> Michael Bierenfeld
> Sent: 13. oktober 2000 13:40
> To: cocoon-users@xml.apache.org
> Subject: Re: Example of included logicsheet
>
>
> Erik Severinsen wrote:
> >
> > With 'included logicsheet' I mean generating an XSP page
> from an initial XML
> > page using XSL.
>
> ?? Good Idea !. Just to be shure the normal way of
> using this is xml->xsp->xsl->html. Are your shure
> that you wanna do xml->xsl-xsp. This means
> something like this.
>
> <function name="main">
>
> 	<mylib:printf>
>
> 		<arg type="String">Hello world</arg>
>
> 	</mylib:printf>
>
> </function>
>
> using xsl this would produce "something" like
> this.
>
> int main () {
> 	printf ("Hello World");
> 	return 0;
> }
>
> Anyway I think the Idea is not too bad.
>
> Regards
>
> Michael
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>


Re: Example of included logicsheet

Posted by Michael Bierenfeld <mi...@atmiralis.de>.
Erik Severinsen wrote:
> 
> With 'included logicsheet' I mean generating an XSP page from an initial XML
> page using XSL.

?? Good Idea !. Just to be shure the normal way of
using this is xml->xsp->xsl->html. Are your shure
that you wanna do xml->xsl-xsp. This means
something like this.

<function name="main">

	<mylib:printf>

		<arg type="String">Hello world</arg>

	</mylib:printf>

</function>

using xsl this would produce "something" like
this.

int main () {
	printf ("Hello World");
	return 0;
}

Anyway I think the Idea is not too bad.

Regards

Michael

RE: Example of included logicsheet

Posted by Erik Severinsen <er...@abnett.no>.
With 'included logicsheet' I mean generating an XSP page from an initial XML
page using XSL.


> Does anyone know of some examples of using incl. logicsheet?
>
> I didn't find any in the samples directory, and the info on
> http://www.suranyami.com/XSPtutorial/index.html is a bit thin.
>
> Thanks
>
> Erik 'Severini' Severinsen :|: ABnett AS :|: Phone/Fax +47 66768600/1
> erik@abnett.no  :|: Mobile: +47 91606563
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>