You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by daniel robinson <dr...@dnai.com> on 2002/06/09 20:12:00 UTC
correct syntax for using variables inside
I am using cinclude successfully in an xsp like this:
<cinclude:include src="mySideBar" element="SideBar"/>
I would like to use a variable, used elsewhere in the xsp, as part of
the src filename:
<xsp:logic>
String sourcePage = "foo";
try
{
sourcePage = parameters.getParameter("SourcePage");
}
catch(Exception e) {
e.printStackTrace();
}
</xsp:logic>
I have tried both:
<cinclude:include
src="c:/files/myIncludeFiles/<xsp:expr>sourcePage</xsp:expr>.xml"
element="SideBar"/>
as well as:
<xsl:variable name="SourcePg"><xsp:expr>sourcePage</xsp:expr></xsl:variable>
<cinclude:include src=":/files/myIncludeFiles/$SourcePg.xml/rss.xml"
element="SideBar"/>
I have been trying to figure this out for some time and have searched
the mail lists - it would be helpful if someone could also point out
(after answering the query) where I should have looked in the doco.
Help appreciated,
Dan
---------------------------------------------------------------------
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>