cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <>
Subject Re: Read XML document via http with variables
Date Mon, 09 Jun 2003 09:58:12 GMT
Hello Daniel,

you probably must build the request string step by step, because the 
variable $cn would not get evaluated otherwise:

<xsl:variable name="xindiceRequestString">
   <xsl:text>?xpath=course[contains(prerequisites/courseno, '</xsl:text>
   <xsl:value-of select="$cn"/>

<xsl:for-each select="document($xindiceRequestString)//course">

1. But be aware of a problem using document():

Maybe it's better to use XInclude or CInclude or sitemap aggregation:

(If you use Cocooon 2.1 simply replace the 2.0 by 2.1.)

2. And is it really necessary to use //course. Double slashes are almost 
always very time-consuming. I would change it to a more exact XPath.

3. Is it possible to replace the server's root 
http://localhost:8080/cocoon1/ by cocoon:/ to access simply Cocoon 
without HTTP. It's only an inner request and much faster:



Daniel Graversen wrote:
> Hi,
> I'm trying to include information from an other document in an XSL. The
> document I'm trying to get is made with Xindice and Cocoon as described in
> tutorial about this, and the command work nicely in my browser.
> I have tried with the following command where I whould like to change XXX
> to anumber i have in the variable $cn.
> <xsl:for-each
> select="document('http://localhost:8080/cocoon1/mount/02288/xmldb2/02288/?xpath=course[contains(prerequisites/courseno,XXXX)]')//course">
>  <xsl:variable name="course" select="@courseno"/>
> ...
> Does any know how to do this.
> Regards,
> daniel

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message