Kaj,
I have no idea why it puts the XML declaration inside the session, but
since my knowlegde of the session transformer is very little I was more
thinking of a different approach.. did you try to use flow for instance
I guess flow can really help you out here?
Regards,
Jeroen Reijn
Kaj Kandler wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Joeren,
thanks for helping me here. I tried a lot of things, off course. But
after hours of experimenting and trying to find some decent logging that
would reveal my problem, I resorted to looking for help.
According to
http://cocoon.apache.org/2.1/developing/webapps/contexts.html, there is
always a temporary context available to do what I want to do (preserve a
value until the end of the request. "Using the tempory context it is
possible to store any XML information for processing the current request."
The attempt to use a path="/key" does no difference.
<session:createcontext name="temp"></session:createcontext>
<session:setxml context="temp" path="/key"><xsl:value-of
select="concat('cu',$rnd)"/></session:setxml>
Makes no difference either.
Here is what the logs have to say:
- ---
DEBUG (2006-10-30) 08:45.55:653 [core.session-manager] (/do-register)
PoolThread-3/DefaultSessionManager: BEGIN setContextFragment name=temp,
path=/key, fragment=<?xml version="1.0" encoding="UTF-8"?>
cu0x8610037794015678
DEBUG (2006-10-30) 08:45.55:653 [core.session-manager.context]
(/do-register) PoolThread-3/DefaultContextManager: BEGIN getContext
name=temp
DEBUG (2006-10-30) 08:45.55:653 [core.session-manager.context]
(/do-register) PoolThread-3/DefaultContextManager: END getContext
[EMAIL PROTECTED]
DEBUG (2006-10-30) 08:45.55:663 [core.session-manager] (/do-register)
PoolThread-3/DefaultSessionManager: END setContextFragment
- ---
I somehow wonder, why it says "<?xml version="1.0" encoding="UTF-8"?>
cu0x8610037794015678" instead of "cu0x8610037794015678"?
Unfortunately I seem not to be able to get the session context in the
sitemap to log anything meaningful.
Once again, thanks for helping me out here.
K<o>
Jeroen Reijn wrote:
Hi Kaj,
i do not have a lot of experience with the session-context and session
transformer, but i will try as much as I can to help you out.
I have a stylesheet that creates a key
- ---
<xsl:stylesheet
version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:session="http://apache.org/cocoon/session/1.0">
<xsl:template match="key">
<!-- create some random number as base for a confirmation URL -->
<xsl:variable name="rnd" select="translate(math:random(),'.','x')"
xmlns:math="xalan://java.lang.Math"/>
<xsl:copy>
<xsl:value-of select="concat('cu',$rnd)"/>
</xsl:copy>
<session:setxml context="temporary" path="my_key"><xsl:value-of
select="concat('cu',$rnd)"/></session:setxml>
</xsl:template>
...
Looking at the documentation about the session-context the following
issues come to mind:
In the example they create their own context first by doing:
<session:createcontext name="trackdemo"/>
Where trackdemo is the context used somewhere else in the xml body like:
<session:mergexml context="trackdemo" path="/context">
So my first question: did you set your context? If so did you try to add
a / in front of your path?
What happens if you do it like this?
Regards,
Jeroen Reijn
Hippo
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
- --
[EMAIL PROTECTED]
http://conficio.blogspot.com/
================================================
| We teach software one screencast at a time |
================================================
http://www.conficio.com/
Tel: +1 (781) 632 5773 - Fax: +1 (781) 207 9159
Conficio
P.O.Box 761062, Melrose,
MA 02176
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
iD8DBQFFRgOvRDUvrJRNjTARAh23AJ9amKR/EZ5oYND6sfcOw2XfIVPl1wCfZP4S
uKe2S9sDxgejCWxpIJXFTO4=
=aQCM
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]