matcher, redirect, and whitespace

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

matcher, redirect, and whitespace

David Lacy
I'm using the redirect/matcher in a simple application and am receiving a "Illegal character in path at index" error when the action contains a whitespace in the redirecting URL.

I've tried using encode-for-uri before the submission but it seems to be ignored during the redirect.

Here's my pertinent data:

page-flow.xml
-------------

<c:config xmlns:c="http://www.orbeon.com/oxf/controller"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:xu="http://www.xmldb.org/xupdate"
        xmlns:oxf="http://www.orbeon.com/oxf/processors"
        >
        <c:page id="navigate" path-info="/redirect/navigate" >
                <c:action>
                        <c:result page="main" transform="oxf:xslt" instance-passing="redirect">
                                <form xmlns="" xsl:version="2.0">
                                        <xsl:copy-of select="doc('input:instance')/action"/>
                                </form>
                        </c:result>
                </c:action>
        </c:page>

        <c:page id="main" path-info="/redirect/([^/]+)" matcher="oxf:perl5-matcher" view="main.xhtml" default-submission="initial-instance.xml">
                <c:setvalue ref="/form/action" matcher-group="1"/>
        </c:page>

        <c:epilogue url="oxf:/config/epilogue.xpl"/>
</c:config>

Submission and Trigger
----------------------

<xforms:submission id="navigate" ref="instance('instance')/action"  method="post" action="/redirect/navigate"/>

<xforms:trigger appearance="xxforms:link">
        <xforms:label>
                <xforms:output value="@name"/>
        </xforms:label>
        <xforms:action ev:event="DOMActivate">
                <xxforms:variable name="action-variable" select="@name" />
                <xforms:setvalue ref="instance('instance')/action" value="encode-for-uri($action-variable)" />
                <xforms:send submission="navigate"/>
        </xforms:action>
</xforms:trigger>


David Lacy
Falvey Library Technology Services
Villanova University
library.villanova.edu
610-519-7361



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: matcher, redirect, and whitespace

David Lacy
I still have not solved my dilemma, but have made some discoveries. Double applying encode-for-uri seems to do the trick, but is nevertheless an undesirable solution.

I have attached a working copy of my example.

Any insight would be great!

David Lacy
Falvey Library Technology Services
Villanova University
library.villanova.edu
610-519-7361


-----Original Message-----
From: David Lacy [mailto:[hidden email]]
Sent: Tuesday, September 15, 2009 2:35 PM
To: [hidden email]
Subject: [ops-users] matcher, redirect, and whitespace

I'm using the redirect/matcher in a simple application and am receiving a "Illegal character in path at index" error when the action contains a whitespace in the redirecting URL.

I've tried using encode-for-uri before the submission but it seems to be ignored during the redirect.

Here's my pertinent data:

page-flow.xml
-------------

<c:config xmlns:c="http://www.orbeon.com/oxf/controller"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:xu="http://www.xmldb.org/xupdate"
        xmlns:oxf="http://www.orbeon.com/oxf/processors"
        >
        <c:page id="navigate" path-info="/redirect/navigate" >
                <c:action>
                        <c:result page="main" transform="oxf:xslt" instance-passing="redirect">
                                <form xmlns="" xsl:version="2.0">
                                        <xsl:copy-of select="doc('input:instance')/action"/>
                                </form>
                        </c:result>
                </c:action>
        </c:page>

        <c:page id="main" path-info="/redirect/([^/]+)" matcher="oxf:perl5-matcher" view="main.xhtml" default-submission="initial-instance.xml">
                <c:setvalue ref="/form/action" matcher-group="1"/>
        </c:page>

        <c:epilogue url="oxf:/config/epilogue.xpl"/> </c:config>

Submission and Trigger
----------------------

<xforms:submission id="navigate" ref="instance('instance')/action"  method="post" action="/redirect/navigate"/>

<xforms:trigger appearance="xxforms:link">
        <xforms:label>
                <xforms:output value="@name"/>
        </xforms:label>
        <xforms:action ev:event="DOMActivate">
                <xxforms:variable name="action-variable" select="@name" />
                <xforms:setvalue ref="instance('instance')/action" value="encode-for-uri($action-variable)" />
                <xforms:send submission="navigate"/>
        </xforms:action>
</xforms:trigger>


David Lacy
Falvey Library Technology Services
Villanova University
library.villanova.edu
610-519-7361



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws

redirect.zip (1K) Download Attachment