cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Sösemann <robert.soesem...@gmx.de>
Subject Generate XSL with XSP?
Date Mon, 03 Mar 2003 18:50:02 GMT
For a context-sensitve basepath setting I want to do this.

1) Add dynamically generated xsl into each (sub-)sitemap:
----------------------------------------------------------

            <map:match pattern="include-basepath.xsl">
                <map:generate src="logicsheets/dynamic-basepath.xsp"
type="xsp">
                    <map:parameter name="basepath" value="/development/"/>
                </map:generate>
                <map:serialize type="xml"/>
            </map:match>


2) Call and use this in every xsl which need the basepath:
---------------------------------------------------------

    <xsl:include href="include-basepath.xsl"/>

The problem is the dynamic-basepath.xsp doesn't generate the xsl I want. In
fact it produces nothing.
WHAT HAVE I DONE WRONG????
(Do I need Meta-STYLESHEETS rather than Meta-XSPs ? If so, cCan anybody tell
me how to write this?)

Here is my xsp:
---------------

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsp:page language="java" xmlns:xsp="http://apache.org/xsp">

<!--
    This XSP should produce the following valid xsl which set a variable

    <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:variable name="basepath">
            <xsl:text>*THE PATH COMING FROM A SITEMAP PARAM*</xsl:text>
        </xsl:variable>
    </xsl:stylesheet>
-->

    <xsp:element name="stylesheet" prefix="xsl"
uri="http://www.w3.org/1999/XSL/Transform">
        <xsp:attribute name="version" value="1.0"/>
        <xsp:attribute name="xmlns:xsl"
value="http://www.w3.org/1999/XSL/Transform"/>

        <xsp:element name="variable" prefix="xsl"
uri="http://www.w3.org/1999/XSL/Transform">
            <xsp:attribute name="name" value="basepath"/>

            <xsp:element name="text" prefix="xsl"
uri="http://www.w3.org/1999/XSL/Transform">
                <xsp:expr>request.getParameter("basepath")</xsp:expr>
            </xsp:element>
        </xsp:element>

    </xsp:element>

</xsp:page>


---------------------------------------------------------------------
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