cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henrik Hofmann" <Henrik.Hofm...@creon-it.com>
Subject RE: C2 Stylesheet, logicsheet and content
Date Wed, 26 Sep 2001 10:09:04 GMT


-----Original Message-----
From: michael@thor.atmiralis.de [mailto:michael@thor.atmiralis.de] On
Behalf Of Michael Bierenfeld
Sent: Mittwoch, 26. September 2001 11:49
To: Cocoon User Mailing List
Subject: C2 Stylesheet, logicsheet and content

Hi once again :-(

C2 is driving me nuts. I can run the xsp examples with no props. I can
evenso run own xsp files without a logicsheet. No Propblem at all. But
what I wanna do right now is the following :

content/greeting.xml                   -> content
logicsheets/logicsheet.greeting.xsl    -> logic
stylesheets/greeeing.xsl               -> style

------------------------------------------------------
I have the following entry in my mounted sitemap :

   <map:match pattern="content/greeting">
    <map:generate type="serverpages" src="content/greeting.xml"/>
    <map:transform src="stylesheets/greeting.xsl"/>
    <map:serialize/>
   </map:match>

-------------------------------------------------------
greeting.xml looks like this :

<?xml version="1.0"?>

<?cocoon-process type="xsp"?>
<?xml-logicsheet href="../logicsheets/logicsheet.greeting.xsl"?>

<xsp:page
    xmlns:xsp="http://www.apache.org/1999/XSP/Core"
    xmlns:greeting="http://duke.edu/tutorial/greeting">

    <greeting>
      [<greeting:hello-world/>]
    </greeting>

</xsp:page>

--------------------------------------------------------
logicsheet.greeting.xsl looks like this :

<?xml version="1.0"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xsp="http://www.apache.org/1999/XSP/Core"
    xmlns:greeting="http://duke.edu/tutorial/greeting"
    version="1.0">

    <xsl:template match="xsp:page">
        <xsl:copy>
            <xsl:apply-templates select="@*"/>
            <xsl:apply-templates/>
       </xsl:copy>

       <xsp:structure>
           <xsp:include>java.text.*</xsp:include>
       </xsp:structure>

        <xsl:copy>
            <xsl:apply-templates select="@*"/>
            <xsl:apply-templates/>
       </xsl:copy>

    </xsl:template>

    <xsl:template match="@*|node()" priority="-1">

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

    </xsl:template>

</xsl:stylesheet>

----------------------------------------------------
+ greeting.xsl as a simple style sheet

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

    <xsl:template match="/">

         <html>
             <body>
                 <h1>
                    <xsl:apply-templates/>hallo Michael Bierenfeld
                 </h1>
             </body>
         </html>

    </xsl:template>

</xsl:stylesheet> 

Hi Michael,

The are some things I Think that don't seem to be right.

At First I don't know what your logicsheet is doing. In your content xml
you have the the elment <greeting:hello-world> (BTW you put it in
braces?). But this element matches nothing in your logicsheet.

Your logicsheet should contain something like this

<xsl:template match="greeting:hello-world">

</xsl:template>

The next point is you need to register your logicsheet in cocoon.xconf
You do this by adding something like this

<builtin-logicsheet>
          <parameter name="prefix" value="greeting"/>
          <parameter name="uri" value="
http://duke.edu/tutorial/greeting "/>
          <parameter name="href" value="resource://path to your
logisheet in jar. logicsheet.greeting.xsl    "/>
</builtin-logicsheet>


It's important to put your logicsheet intp a jar file containing the
right directory structure.

Bye 


---------------------------------------------------------------------
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: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message