I've found a work-around:

<?xml version="1.0" ?>
<test xmlns:session="http://cocoon.apache.org/session/1.0";>
        <session:createcontext name="sessionTest" />
        <session:setxml context="sessionTest" path="/">
                <root>
                        <stem id="1">foo</stem>
                        <stem id="2">bar</stem>
                </root>
        </session:setxml>
        <!-- this doesn't do what I thought it would
        <session:mergexml context="sessionTest" 
path="/root/stem[id='1']">fred</session:setxml>
        -->
        <!-- but this does -->
        <session:mergexml context="sessionTest" path="/root">
                <stem id="1">fred</stem>
        </session:mergexml>
        <session:getxml context="sessionTest" path="/" />
</test>

Bruce

>>> [EMAIL PROTECTED] 05/30/02 04:08PM >>>
I just took a quick look at the code and it seems like this should work the way I 
thought it would.  I've been working with the CVS HEAD (which today is having some 
problems with the sitemap), JDK 1.3.1_02 and Win2K.

Does anyone have any ideas?

Thanks

>>> [EMAIL PROTECTED] 05/23/02 03:44PM >>>
I've found something else that doesn't work the way I think it should... ;)

I thought this XML:

<?xml version="1.0" ?>
<test xmlns:session="http://cocoon.apache.org/session/1.0";>
        <session:createcontext name="sessionTest" />
        <session:setxml context="sessionTest" path="/">
                <root>
                        <stem id="1">foo</stem>
                        <stem id="2">bar</stem>
                </root>
        </session:setxml>
        <session:mergexml context="sessionTest" 
path="/root/stem[id='1']">fred</session:mergexml>
        <session:getxml context="sessionTest" path="/" />
</test>

would create this output:

<?xml version="1.0" encoding="UTF-8"?>
<test xmlns:session="http://cocoon.apache.org/session/1.0";>
        <root>
                <stem id="1">fred</stem>
                <stem id="2">bar</stem>
        </root>
</test>

but instead it creates:

<?xml version="1.0" encoding="UTF-8"?>
<test xmlns:session="http://cocoon.apache.org/session/1.0";>
        <root>
                <stem id="1">foo</stem>
                <stem id="2">bar</stem>
                <stem>fred</stem>
        </root>
</test>

The same happens if I use setxml in place of mergexml.

I really like the idea of the session transformer and I am probably expecting too 
much.  What are the current thoughts for the most Cocoon-ish way to handle the session 
problem?

Kindest regards,
Bruce



---------------------------------------------------------------------
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>



---------------------------------------------------------------------
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>



---------------------------------------------------------------------
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to