XInclude of submission element

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

XInclude of submission element

Henrik Pettersen
All,

when I do this:
---------------------
...
    <xforms:submission id="help-submission"
                   ref="instance('rule-instance')"
                   method="get"
                   action="/home" xmlns:xforms="http://www.w3.org/2002/xforms"/>

</xforms:model>


everything works fine.


But when I do this:
---------------------------
...
    <xi:include href="/styling/navigation.home.submission.xml"/>

</xforms:model>


with this content of /styling/navigation.home.submission.xml:
----------------------------------------------------------------------------------------
<xforms:submission id="help-submission"
                   ref="instance('rule-instance')"
                   method="get"
                   action="/home" xmlns:xforms="http://www.w3.org/2002/xforms"/>


clicking on the button gives you this error message from Firefox:
---------------------------------------------------------------------------------------------
"Firefox doesn't know how to open this address, because the protocol
(oxf) isn't associated with any program"


Is this a bug? Sorry for not sending a test case, but I believe you
can reproduce the problem by taking any xforms:submit element, putting
it in another file and xincluding this file.

BTW, I look forward to xpointer support for xinclude in the future. It
would seriously reduce the number of files I need for my templating,
and possibly for my internationalization efforts, as well.

Sincerely,
Henrik Pettersen
Advanced Computation Laboratory
Cancer Research UK



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: XInclude of submission element

Erik Bruchez
Administrator
Henrik,

 > when I do this:
 > ---------------------
 > ...
 >    <xforms:submission id="help-submission"
 >                   ref="instance('rule-instance')"
 >                   method="get"
 >                   action="/home"
 > xmlns:xforms="http://www.w3.org/2002/xforms"/>
 >
 > </xforms:model>
 >
 >
 > everything works fine.
 >
 >
 > But when I do this:
 > ---------------------------
 > ...
 >    <xi:include href="/styling/navigation.home.submission.xml"/>
 >
 > </xforms:model>
 >
 >
 > with this content of /styling/navigation.home.submission.xml:
 >
----------------------------------------------------------------------------------------

 >
 > <xforms:submission id="help-submission"
 >                   ref="instance('rule-instance')"
 >                   method="get"
 >                   action="/home"
 > xmlns:xforms="http://www.w3.org/2002/xforms"/>
 >
 >
 > clicking on the button gives you this error message from Firefox:
 >
---------------------------------------------------------------------------------------------

 >
 > "Firefox doesn't know how to open this address, because the protocol
 > (oxf) isn't associated with any program"
 >
 >
 > Is this a bug?

For once, I think not ;-)

 > Sorry for not sending a test case, but I believe you can reproduce
 > the problem by taking any xforms:submit element, putting it in
 > another file and xincluding this file.

What is happening when you use XInclude is that the result of the
inclusion contains an xml:base attribute. There, that xml:base
attribute will be something like:

   xml:base="oxf:/path/to/your/including/file"

The xforms:submission, when resolving the relative action (/home)
actually performs xml:base resolution. This explains why now you are
submitting to an oxf: URI.

To fix this, you can prevent XInclude to generate xml:base, with an
extension attribute:

   <xi:include xxi:omit-xml-base="true" href="..."/>

With xxi mapped as follows:

   xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"

 > BTW, I look forward to xpointer support for xinclude in the future. It
 > would seriously reduce the number of files I need for my templating,
 > and possibly for my internationalization efforts, as well.

Agreed.

-Erik

--
Orbeon Forms - XForms Everywhere
http://www.orbeon.com/blog/




--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: XInclude of submission element

Henrik Pettersen
Erik,

Ah, now I understand the xml:base issue. Thanks!

Henrik

On 11/29/06, Erik Bruchez <[hidden email]> wrote:
Henrik,

> when I do this:
> ---------------------
> ...
>    <xforms:submission id="help-submission"
>                   ref="instance('rule-instance')"
>                   method="get"
>                   action="/home"
> xmlns:xforms="http://www.w3.org/2002/xforms"/>
>
> </xforms:model>
>
>
> everything works fine.
>
>
> But when I do this:
> ---------------------------
> ...
>    <xi:include href="/styling/navigation.home.submission.xml"/>
>
> </xforms:model>
>
>
> with this content of /styling/navigation.home.submission.xml:
>
----------------------------------------------------------------------------------------

>
> <xforms:submission id="help-submission"
>                   ref="instance('rule-instance')"
>                   method="get"
>                   action="/home"
> xmlns:xforms=" http://www.w3.org/2002/xforms"/>
>
>
> clicking on the button gives you this error message from Firefox:
>
---------------------------------------------------------------------------------------------

>
> "Firefox doesn't know how to open this address, because the protocol
> (oxf) isn't associated with any program"
>
>
> Is this a bug?

For once, I think not ;-)

> Sorry for not sending a test case, but I believe you can reproduce
> the problem by taking any xforms:submit element, putting it in
> another file and xincluding this file.

What is happening when you use XInclude is that the result of the
inclusion contains an xml:base attribute. There, that xml:base
attribute will be something like:

   xml:base="oxf:/path/to/your/including/file"

The xforms:submission, when resolving the relative action (/home)
actually performs xml:base resolution. This explains why now you are
submitting to an oxf: URI.

To fix this, you can prevent XInclude to generate xml:base, with an
extension attribute:

   <xi:include xxi:omit-xml-base="true" href="..."/>

With xxi mapped as follows:

   xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"

> BTW, I look forward to xpointer support for xinclude in the future. It
> would seriously reduce the number of files I need for my templating,
> and possibly for my internationalization efforts, as well.

Agreed.

-Erik

--
Orbeon Forms - XForms Everywhere
http://www.orbeon.com/blog/





--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws





--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws