You both seem to assume i'm expecting a date in the query string
like: http://yourhost/.../cdls_artikelen.xml?date=something
I'm not expecting this.
I want to use the cocoon inputmodules
http://cocoon.apache.org/2.1/userdocs/concepts/modules.html
On this page under USE IT... you see the example:
<map:parameter name="users-home-base"
value="{system-property:substring-before(user.home, user.name)}"/>
I wanted to use the DateInputModule which is described at:
http://cocoon.apache.org/2.1/userdocs/concepts/modules-ref.html
In my cocoon.xconf this module is present en stated as referable by {date}
can you (or anybody else) see where i'm going wrong!
Gerritjan Koekkoek
Op 10-okt-04 om 23:56 heeft Brian Vargas het volgende geschreven:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hey,
Another alternative, if your variable is in the query string, is to use the
Request Parameter input module. Your sitemap would look something like:
<map:match pattern="cdls_artikelen.xml">
<map:generate src="cocoon:/cdls_artikelen_lijst.xml"/>
<map:transform src="style/xsl/artikel_lijst2artikel.xsl">
<map:parameter name="p_datum" value="{request-param:date}"/>
</map:transform>
<map:serialize type="xml"/>
</map:match>
This causes the sitemap to ask the input module bound to the "request-param"
prefix for the value "date." That input module will, by default, look at the
query string and pull out the value from there.
Brian
Andre Juffer wrote:
Gerrit-Jan,-----BEGIN PGP SIGNATURE-----
as far as I can see, the parameter 'date' in the sitemap is not set
anywhere. I don't see immediately anything wrong in your files. I assume
you are calling this pipeline with something like
http://yourhost/.../cdls_artikelen.xml?date=something
You probably would need to extract the value of 'date' from the request.
Try to use <map:act type="request">, which makes all request parameters
available to the sitemap:
<map:match pattern="cdls_artikelen.xml">
<map:act type="request">
<map:parameter name="parameters" value="true" />
<map:generate src="cocoon:/cdls_artikelen_lijst.xml"/>
<map:transform src="style/xsl/artikel_lijst2artikel.xsl">
<map:parameter name="p_datum" value="{date}"/>
</map:transform>
<map:serialize type="xml"/>
</map:act>
.....
</map:match>
'date' is set by the action.
Alternatively, you could make all request parameters available to the
stylesheet artikel_lijst2artikel.xsl, in which case you would not need
to set the 'date' in the sitemap.
Cheers,
Andre.
gerritjan wrote:
Hello,
My sitemap looks like:
<map:match pattern="cdls_artikelen.xml">
<map:generate src="cocoon:/cdls_artikelen_lijst.xml"/>
<map:transform src="style/xsl/artikel_lijst2artikel.xsl">
<map:parameter name="p_datum" value="{date}"/>
</map:transform>
<map:serialize type="xml"/>
</map:match>
My "style/xsl/artikel_lijst2artikel.xsl" looks like:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dir="http://apache.org/cocoon/directory/2.0">
<xsl:param name="p_datum"/>
<xsl:template match="dir:directory" >
<basis>
<onderwerpen datum_vandaag="{$p_datum}">
<xsl:for-each select="dir:file">
<xsl:variable name="xml_bestand">../../content/artikelen/<xsl:value-of
select="@name"/></xsl:variable>
<xsl:apply-templates
select="document($xml_bestand)/child::onderwerpen/child::onderwerp">
<xsl:with-param name="p_bestand"><xsl:value-of
select="substring-before(@name,'.xml')"/></xsl:with-param>
</xsl:apply-templates>
</xsl:for-each>
</onderwerpen>
</basis>
</xsl:template>
My output looks like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<basis xmlns:dir="http://apache.org/cocoon/directory/2.0">
<onderwerpen datum_vandaag="">
<onderwerp>...
</onderwerp>
</onderwerpen>
</basis>
The parameter value does not show up as the attribute value of
attribute "datum_vandaag"
I tried to replace the {date} (in the sitemap!) with
{system-property:substring-before(user.home, user.name)}
(used in the cocoon documentation!)
What am I missing?
*/_Gerritjan Koekkoek_/*
Version: GnuPG v1.2.4 (MingW32)
Comment: What is this? http://pgp.ardvaark.net
iD8DBQFBabAp3YdPnMKx1eMRAkFQAKDDqK2OGn2FUpdPBlThl536TcsIPQCfRyRC
n/PrzTTdpGjnAYBHFd+A/2E=
=MVFo
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
