Bug with xi:include, xf:output mediatype="image/*" and with xf:insert

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

Bug with xi:include, xf:output mediatype="image/*" and with xf:insert

Fabien GUENEGO
Hello,

well all is in the question :-)

I have written a simple reproducible case illustrating this problem.

I have an instance with 2 text-node. Each text-node is replace with an
image in the body. No problem for the moment.
With a trigger, I add a new text-node in the instance. But no image
appear if the xf:output are in a xi:include...
There is none problem when i don't use an xi:include.

Is it a programming error from me?

I don't find the bug. Please help.

Fabien

This is the 2 files and the image.
The main:
<?xml version="1.0" encoding="ISO-8859-1"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ev="http://www.w3.org/2001/xml-events"
     xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
     xmlns:xi="http://www.w3.org/2001/XInclude"    
xmlns:xf="http://www.w3.org/2002/xforms">
<head>
<title>Images</title>

<xf:model id="menuModel">

<xf:instance id="rep" xmlns="">
<rep>more-image</rep>
</xf:instance>

<xf:instance id="tableInstance" xmlns="">
<table>
<rep>imageA</rep>
<rep>imageB</rep>
</table>
</xf:instance>

</xf:model>
</head>
<body>
<xf:group>

<xf:trigger>
<xf:label>Insert a new image</xf:label>
<xf:action ev:event="DOMActivate">
<xf:insert context="xxforms:instance('tableInstance')"
                         nodeset="rep" origin="xxforms:instance('rep')" />
</xf:action>
</xf:trigger>
<br />
             Here
<xf:repeat nodeset="xxforms:instance('tableInstance')//rep">
<span>
<xf:output mediatype="image/png"
                         
value="'/apps/competences/dist/images/iconesite.png'" />
</span>
</xf:repeat>
             End
</xf:group>
<br />
<xi:include href="moduleTest.xml" />
<fr:xforms-inspector />
</body>
</html>

The include-file:
<?xml version="1.0" encoding="ISO-8859-1"?>

<xf:group xmlns="http://www.w3.org/1999/xhtml"
xmlns:ev="http://www.w3.org/2001/xml-events"
     xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
     xmlns:xf="http://www.w3.org/2002/xforms">

<xf:trigger>
<xf:label>Insert a new image in a xi:include</xf:label>
<xf:action ev:event="DOMActivate">
<xf:insert context="xxforms:instance('tableInstance')"
                 nodeset="rep" origin="xxforms:instance('rep')" />
</xf:action>
</xf:trigger>
<br />
     Here
<xf:repeat nodeset="xxforms:instance('tableInstance')//rep">
<span>
<xf:output mediatype="image/png" value="'iconesite.png'" />
</span>
</xf:repeat>
     End
</xf:group>

And the image is join with this mail.


--
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

iconesite.png (3K) Download Attachment
moduleTest.xml (1022 bytes) Download Attachment
testImage.xhtml (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Bug with xi:include, xf:output mediatype="image/*" and with xf:insert

Erik Bruchez
Administrator
Fabien,

xi:include adds an xml:base attribute which might change the base URL
for resolution. Try:

<xi:include href="moduleTest.xml" xxi:omit-xml-base="true"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"/>

-Erik

On Thu, Sep 16, 2010 at 1:57 PM, Fabien GUENEGO <[hidden email]> wrote:

> Hello,
>
> well all is in the question :-)
>
> I have written a simple reproducible case illustrating this problem.
>
> I have an instance with 2 text-node. Each text-node is replace with an image
> in the body. No problem for the moment.
> With a trigger, I add a new text-node in the instance. But no image appear
> if the xf:output are in a xi:include...
> There is none problem when i don't use an xi:include.
>
> Is it a programming error from me?
>
> I don't find the bug. Please help.
>
> Fabien
>
> This is the 2 files and the image.
> The main:
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <html xmlns="http://www.w3.org/1999/xhtml"
> xmlns:ev="http://www.w3.org/2001/xml-events"
>    xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
> xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
>    xmlns:xi="http://www.w3.org/2001/XInclude"
>  xmlns:xf="http://www.w3.org/2002/xforms">
> <head>
> <title>Images</title>
>
> <xf:model id="menuModel">
>
> <xf:instance id="rep" xmlns="">
> <rep>more-image</rep>
> </xf:instance>
>
> <xf:instance id="tableInstance" xmlns="">
> <table>
> <rep>imageA</rep>
> <rep>imageB</rep>
> </table>
> </xf:instance>
>
> </xf:model>
> </head>
> <body>
> <xf:group>
>
> <xf:trigger>
> <xf:label>Insert a new image</xf:label>
> <xf:action ev:event="DOMActivate">
> <xf:insert context="xxforms:instance('tableInstance')"
>                        nodeset="rep" origin="xxforms:instance('rep')" />
> </xf:action>
> </xf:trigger>
> <br />
>            Here
> <xf:repeat nodeset="xxforms:instance('tableInstance')//rep">
> <span>
> <xf:output mediatype="image/png"
>                        value="'/apps/competences/dist/images/iconesite.png'"
> />
> </span>
> </xf:repeat>
>            End
> </xf:group>
> <br />
> <xi:include href="moduleTest.xml" />
> <fr:xforms-inspector />
> </body>
> </html>
>
> The include-file:
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <xf:group xmlns="http://www.w3.org/1999/xhtml"
> xmlns:ev="http://www.w3.org/2001/xml-events"
>    xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
> xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
>    xmlns:xf="http://www.w3.org/2002/xforms">
>
> <xf:trigger>
> <xf:label>Insert a new image in a xi:include</xf:label>
> <xf:action ev:event="DOMActivate">
> <xf:insert context="xxforms:instance('tableInstance')"
>                nodeset="rep" origin="xxforms:instance('rep')" />
> </xf:action>
> </xf:trigger>
> <br />
>    Here
> <xf:repeat nodeset="xxforms:instance('tableInstance')//rep">
> <span>
> <xf:output mediatype="image/png" value="'iconesite.png'" />
> </span>
> </xf:repeat>
>    End
> </xf:group>
>
> And the image is join with this mail.
>
>
> --
> 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
>
>


--
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: Re: Bug with xi:include, xf:output mediatype="image/*" and with xf:insert

Fabien GUENEGO
Thanks for your help :-)

In reality, my problem was bigger. Before I see the "testImage.xhtml", I use an XPL file with a "oxf:url-generator". And, I found that the problem was with the url-generator. (Always the pb with the image (no appears)) I saw that with a "oxf:xinclude", There was no problem but I should use a dynamic url ...
After several hours, i found the solution. If it could help an other guy :-), this is my XPL file:

<?xml version="1.0" encoding="ISO-8859-1"?>
<p:config xmlns:oxf="http://www.orbeon.com/oxf/processors"
    xmlns:p="http://www.orbeon.com/oxf/pipeline">

    <p:param type="output" name="data" />

<!-- I could use an XSLT-processor for a dynamic url -->
    <p:processor name="oxf:url-generator">
        <p:input name="config">
            <config>
                <url>testImage.xhtml</url>
                <content-type>application/xml</content-type>
                <handle-xinclude>false</handle-xinclude>   <!-- Here is the tip :-) -->
            </config>
        </p:input>
        <p:output name="data" id="dataGen" />
    </p:processor>
 
    <p:processor name="oxf:xinclude">
        <p:input name="config" href="#dataGen" />
        <p:output name="data" id="result" ref="data" />
    </p:processor>

</p:config>


Thanks again
Fabien
PS: If there is an other solution I was interessed.



Le 21/09/2010 04:50, Erik Bruchez a écrit :
Fabien,

xi:include adds an xml:base attribute which might change the base URL
for resolution. Try:

<xi:include href="moduleTest.xml" xxi:omit-xml-base="true"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"/>

-Erik

On Thu, Sep 16, 2010 at 1:57 PM, Fabien GUENEGO [hidden email] wrote:
  
Hello,

well all is in the question :-)

I have written a simple reproducible case illustrating this problem.

I have an instance with 2 text-node. Each text-node is replace with an image
in the body. No problem for the moment.
With a trigger, I add a new text-node in the instance. But no image appear
if the xf:output are in a xi:include...
There is none problem when i don't use an xi:include.

Is it a programming error from me?

I don't find the bug. Please help.

Fabien

This is the 2 files and the image.
The main:
<?xml version="1.0" encoding="ISO-8859-1"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ev="http://www.w3.org/2001/xml-events"
   xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
   xmlns:xi="http://www.w3.org/2001/XInclude"
 xmlns:xf="http://www.w3.org/2002/xforms">
<head>
<title>Images</title>

<xf:model id="menuModel">

<xf:instance id="rep" xmlns="">
<rep>more-image</rep>
</xf:instance>

<xf:instance id="tableInstance" xmlns="">
<table>
<rep>imageA</rep>
<rep>imageB</rep>
</table>
</xf:instance>

</xf:model>
</head>
<body>
<xf:group>

<xf:trigger>
<xf:label>Insert a new image</xf:label>
<xf:action ev:event="DOMActivate">
<xf:insert context="xxforms:instance('tableInstance')"
                       nodeset="rep" origin="xxforms:instance('rep')" />
</xf:action>
</xf:trigger>
<br />
           Here
<xf:repeat nodeset="xxforms:instance('tableInstance')//rep">
<span>
<xf:output mediatype="image/png"
                       value="'/apps/competences/dist/images/iconesite.png'"
/>
</span>
</xf:repeat>
           End
</xf:group>
<br />
<xi:include href="moduleTest.xml" />
<fr:xforms-inspector />
</body>
</html>

The include-file:
<?xml version="1.0" encoding="ISO-8859-1"?>

<xf:group xmlns="http://www.w3.org/1999/xhtml"
xmlns:ev="http://www.w3.org/2001/xml-events"
   xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
   xmlns:xf="http://www.w3.org/2002/xforms">

<xf:trigger>
<xf:label>Insert a new image in a xi:include</xf:label>
<xf:action ev:event="DOMActivate">
<xf:insert context="xxforms:instance('tableInstance')"
               nodeset="rep" origin="xxforms:instance('rep')" />
</xf:action>
</xf:trigger>
<br />
   Here
<xf:repeat nodeset="xxforms:instance('tableInstance')//rep">
<span>
<xf:output mediatype="image/png" value="'iconesite.png'" />
</span>
</xf:repeat>
   End
</xf:group>

And the image is join with this mail.


--
You receive this message as a subscriber of the [hidden email] mailing
list.
To unsubscribe: [hidden email]
For general help: [hidden email]
OW2 mailing lists service home page: http://www.ow2.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
OW2 mailing lists service home page: http://www.ow2.org/wws