You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Robert Sösemann <ro...@gmx.de> on 2003/03/03 19:50:02 UTC

Generate XSL with XSP?

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


Re: Generate XSL with XSP?

Posted by ro...@gmx.de.
Sorry for accidentally sending private mail to the list.

My fault. Won't happen again.

Robert
> Du hast es hingekriegt ?!!! Yipeeeeeeeeeeeeee! Ich habs genahnt das das
> geht.
> 
> Super, danke Thommi, must mir heute abend mal zeigen was bei mir falsch
> war.
> Dann kannste ja mindestens 4 XSL wegschmeissen
> Und dann gibts auch nur noch basepath und net mehr cms.
> 
> Coooooooool Rob
> ----- Original Message -----
> From: "Thomas Haditsch" <th...@thomminator.de>
> To: <co...@xml.apache.org>
> Sent: Tuesday, March 04, 2003 3:22 AM
> Subject: Re: Generate XSL with XSP?
> 
> 
> sorry, should have used 'cocoon:/' instead of 'cocoon://'. that solved the
> problem!
> 
> At 03:19 04.03.2003 +0100, you wrote:
> >no, that's not the problem. i managed to dynamically create the xsl using
> >a custom generator instead of a xsp, but now the xsl that includes it
> >complains that the variable 'basepath' has not been defined if i do it
> >this way:
> ><xsl:include href="cocoon://include-basepath.xsl"/>
> >
> >and if i do
> ><xsl:include href="include-basepath.xsl"/>
> >it tries to load the file from disk.
> >
> >any ideas if (and how) this can be solved?
> >
> >thanx in advance,
> >thomas
> >
> >
> >At 00:47 04.03.2003 +0100, you wrote:
> >>Thanks alot for your answer. Yes that was wrong BUT I didn't even came
> to
> >>the point where including the stylesheet was of interest.
> >>
> >>That is because the XSP did never generate the desired XSL.  The output
> of
> >>my XSP was just an emtpty <?xml ...> Tag.
> >>No other elements were created. I guess it a namespace problem. What do
> you
> >>think?
> >>
> >>Robert
> >>----- Original Message -----
> >>From: "Upayavira" <uv...@upaya.co.uk>
> >>To: "Robert Sösemann" <ro...@gmx.de>;
> >><co...@xml.apache.org>
> >>Sent: Monday, March 03, 2003 8:03 PM
> >>Subject: Re: Generate XSL with XSP?
> >>
> >>
> >> > Robert,
> >> >
> >> > >     <xsl:include href="include-basepath.xsl"/>
> >> >
> >> > Is it as simple as changing this line to:
> >> >      <xsl:include href="cocoon:/include-basepath.xsl"/>
> >> > to allow the include to call an internal pipeline?
> >> >
> >> > Regards, Upayavira
> >> >
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> >> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
> >> >
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> >>For additional commands, e-mail: cocoon-users-help@xml.apache.org
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> >For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Generate XSL with XSP?

Posted by Robert Sösemann <ro...@gmx.de>.
Du hast es hingekriegt ?!!! Yipeeeeeeeeeeeeee! Ich habs genahnt das das
geht.

Super, danke Thommi, must mir heute abend mal zeigen was bei mir falsch war.
Dann kannste ja mindestens 4 XSL wegschmeissen
Und dann gibts auch nur noch basepath und net mehr cms.

Coooooooool Rob
----- Original Message -----
From: "Thomas Haditsch" <th...@thomminator.de>
To: <co...@xml.apache.org>
Sent: Tuesday, March 04, 2003 3:22 AM
Subject: Re: Generate XSL with XSP?


sorry, should have used 'cocoon:/' instead of 'cocoon://'. that solved the
problem!

At 03:19 04.03.2003 +0100, you wrote:
>no, that's not the problem. i managed to dynamically create the xsl using
>a custom generator instead of a xsp, but now the xsl that includes it
>complains that the variable 'basepath' has not been defined if i do it
>this way:
><xsl:include href="cocoon://include-basepath.xsl"/>
>
>and if i do
><xsl:include href="include-basepath.xsl"/>
>it tries to load the file from disk.
>
>any ideas if (and how) this can be solved?
>
>thanx in advance,
>thomas
>
>
>At 00:47 04.03.2003 +0100, you wrote:
>>Thanks alot for your answer. Yes that was wrong BUT I didn't even came to
>>the point where including the stylesheet was of interest.
>>
>>That is because the XSP did never generate the desired XSL.  The output of
>>my XSP was just an emtpty <?xml ...> Tag.
>>No other elements were created. I guess it a namespace problem. What do
you
>>think?
>>
>>Robert
>>----- Original Message -----
>>From: "Upayavira" <uv...@upaya.co.uk>
>>To: "Robert Sösemann" <ro...@gmx.de>;
>><co...@xml.apache.org>
>>Sent: Monday, March 03, 2003 8:03 PM
>>Subject: Re: Generate XSL with XSP?
>>
>>
>> > Robert,
>> >
>> > >     <xsl:include href="include-basepath.xsl"/>
>> >
>> > Is it as simple as changing this line to:
>> >      <xsl:include href="cocoon:/include-basepath.xsl"/>
>> > to allow the include to call an internal pipeline?
>> >
>> > Regards, Upayavira
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
>> >
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>For additional commands, e-mail: cocoon-users-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Generate XSL with XSP?

Posted by Thomas Haditsch <th...@thomminator.de>.
sorry, should have used 'cocoon:/' instead of 'cocoon://'. that solved the 
problem!

At 03:19 04.03.2003 +0100, you wrote:
>no, that's not the problem. i managed to dynamically create the xsl using
>a custom generator instead of a xsp, but now the xsl that includes it
>complains that the variable 'basepath' has not been defined if i do it 
>this way:
><xsl:include href="cocoon://include-basepath.xsl"/>
>
>and if i do
><xsl:include href="include-basepath.xsl"/>
>it tries to load the file from disk.
>
>any ideas if (and how) this can be solved?
>
>thanx in advance,
>thomas
>
>
>At 00:47 04.03.2003 +0100, you wrote:
>>Thanks alot for your answer. Yes that was wrong BUT I didn't even came to
>>the point where including the stylesheet was of interest.
>>
>>That is because the XSP did never generate the desired XSL.  The output of
>>my XSP was just an emtpty <?xml ...> Tag.
>>No other elements were created. I guess it a namespace problem. What do you
>>think?
>>
>>Robert
>>----- Original Message -----
>>From: "Upayavira" <uv...@upaya.co.uk>
>>To: "Robert Sösemann" <ro...@gmx.de>;
>><co...@xml.apache.org>
>>Sent: Monday, March 03, 2003 8:03 PM
>>Subject: Re: Generate XSL with XSP?
>>
>>
>> > Robert,
>> >
>> > >     <xsl:include href="include-basepath.xsl"/>
>> >
>> > Is it as simple as changing this line to:
>> >      <xsl:include href="cocoon:/include-basepath.xsl"/>
>> > to allow the include to call an internal pipeline?
>> >
>> > Regards, Upayavira
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
>> >
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>>For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>For additional commands, e-mail: cocoon-users-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Generate XSL with XSP?

Posted by Thomas Haditsch <th...@thomminator.de>.
no, that's not the problem. i managed to dynamically create the xsl using
a custom generator instead of a xsp, but now the xsl that includes it
complains that the variable 'basepath' has not been defined if i do it this 
way:
<xsl:include href="cocoon://include-basepath.xsl"/>

and if i do
<xsl:include href="include-basepath.xsl"/>
it tries to load the file from disk.

any ideas if (and how) this can be solved?

thanx in advance,
thomas


At 00:47 04.03.2003 +0100, you wrote:
>Thanks alot for your answer. Yes that was wrong BUT I didn't even came to
>the point where including the stylesheet was of interest.
>
>That is because the XSP did never generate the desired XSL.  The output of
>my XSP was just an emtpty <?xml ...> Tag.
>No other elements were created. I guess it a namespace problem. What do you
>think?
>
>Robert
>----- Original Message -----
>From: "Upayavira" <uv...@upaya.co.uk>
>To: "Robert Sösemann" <ro...@gmx.de>;
><co...@xml.apache.org>
>Sent: Monday, March 03, 2003 8:03 PM
>Subject: Re: Generate XSL with XSP?
>
>
> > Robert,
> >
> > >     <xsl:include href="include-basepath.xsl"/>
> >
> > Is it as simple as changing this line to:
> >      <xsl:include href="cocoon:/include-basepath.xsl"/>
> > to allow the include to call an internal pipeline?
> >
> > Regards, Upayavira
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
> >
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>For additional commands, e-mail: cocoon-users-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Generate XSL with XSP?

Posted by Robert Sösemann <ro...@gmx.de>.
Thanks alot for your answer. Yes that was wrong BUT I didn't even came to
the point where including the stylesheet was of interest.

That is because the XSP did never generate the desired XSL.  The output of
my XSP was just an emtpty <?xml ...> Tag.
No other elements were created. I guess it a namespace problem. What do you
think?

Robert
----- Original Message -----
From: "Upayavira" <uv...@upaya.co.uk>
To: "Robert Sösemann" <ro...@gmx.de>;
<co...@xml.apache.org>
Sent: Monday, March 03, 2003 8:03 PM
Subject: Re: Generate XSL with XSP?


> Robert,
>
> >     <xsl:include href="include-basepath.xsl"/>
>
> Is it as simple as changing this line to:
>      <xsl:include href="cocoon:/include-basepath.xsl"/>
> to allow the include to call an internal pipeline?
>
> Regards, Upayavira
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Generate XSL with XSP?

Posted by Upayavira <uv...@upaya.co.uk>.
Robert,

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

Is it as simple as changing this line to:
     <xsl:include href="cocoon:/include-basepath.xsl"/>
to allow the include to call an internal pipeline?

Regards, Upayavira


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org