Custom XBL receives trimmed data.

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

Custom XBL receives trimmed data.

cvesters
This post was updated on .
I am having a small problem. I have a custom XBL component, but the data it gets seems to be trimmed.

On the page there is this:

<idfc:tabview>
        <idfc:tab tab-height="126.5pt" tab-width="355.0pt">
                <idfc:label>
                        <div class="clearer" />
                </idfc:label>
                <idfc:content style="padding-top: 1.95pt; padding-right: 1.95pt; padding-left: 1.95pt; position: relative; min-height: 122.55pt;">
                <div>
                        <div class="clearer" />
                        <div style="display: inline;">Hello </div>
                        <div style="display: inline;"> World? </div>
                </div>
                </idfc:content>
        </idfc:tab>
</idfc:tabview>

But the XBL components seems to receive divs which are trimmed (by which I mean that the spaces before and after the content of the div have been removed). I am trying to figure out where the data comes from to identify the cause.

Kind regards,
Chris Vesters
Reply | Threaded
Open this post in threaded view
|

Re: Custom XBL receives trimmed data.

cvesters
This post was updated on .
I just tried doing the exact same thing with the Orbeon table view:

<fr:tabview>
        <fr:tab tab-height="126.5pt" tab-width="355.0pt">
                <fr:label>
                        <div class="clearer" />
                </fr:label>
                <div>
                        <div class="clearer" />
                        <div style="display: inline;">Hello </div>
                        <div style="display: inline;"> World? </div>
                </div>
        </fr:tab>
</fr:tabview>

The same happens as with the custom XBL. Is this a bug? Or has it a purpose? Is there a way to prevent this behaviour?
Reply | Threaded
Open this post in threaded view
|

Re: Custom XBL receives trimmed data.

Erik Bruchez
Administrator
Are your HTML elements in a namespace (since I notice you HTML elements don't have a prefix)? If not, does it makes a difference if you place your HTML elements in a namespace, e.g.:

    <div xmlns="http://www.w3.org/1999/xhtml">
            <div class="clearer" />
            <div style="display: inline;">Hello </div>
            <div style="display: inline;"> World? </div>
    </div>

-Erik
Reply | Threaded
Open this post in threaded view
|

Re: Custom XBL receives trimmed data.

Erik Bruchez
Administrator
And to answer one of your questions along the way, yes, there is whitespace trimming happening. I don't know if that's what's causing the issue here, for some background information see this post:

    http://blog.orbeon.com/2013/11/saving-memory-by-removing-unneeded.html

-Erik
Reply | Threaded
Open this post in threaded view
|

Re: Custom XBL receives trimmed data.

cvesters
Adding a namespace to the elements doesn't make a difference.
A workaround for the moment is to replace the whitespaces with a non-breaking space.
Reply | Threaded
Open this post in threaded view
|

Re: Custom XBL receives trimmed data.

cvesters
This post was updated on .
I found the solution to this problem.

I have to modify the configuration option:
oxf.xforms.whitespace.base.collapse

When I add the XBL (idfc|content) to it, it works.

A new question now is, can I override this property without losing all the other predefined values?
xf|label, xf|help, xf|hint, xf|alert, xf|message, xbl|template, xxbl|global

I know I can override the property, but I guess the new value does not get added to the list, but overrides all the values. So to add it, I need to copy the entire list?

I tried doing it in a properties-local.xml file, but I failed to get it working.
Reply | Threaded
Open this post in threaded view
|

Re: Custom XBL receives trimmed data.

Erik Bruchez
Administrator
So what does your property look like right now exactly?

-Erik
Reply | Threaded
Open this post in threaded view
|

Re: Custom XBL receives trimmed data.

cvesters
The property currently is like this:

<property as="xs:string"  name="oxf.xforms.whitespace.base.collapse"
       value="xf|label, xf|help, xf|hint, xf|alert, xf|message, xbl|template, xxbl|global, idfc|content"/>

That is for the properties-xforms.xml files. I didn't succeed in setting it in a local configuration file.
I always ended up with 'unknown key' exceptions.
Reply | Threaded
Open this post in threaded view
|

Re: Custom XBL receives trimmed data.

Erik Bruchez
Administrator
I entered and fixed the following issue:

    https://github.com/orbeon/orbeon-forms/issues/2377

For now you should be able to just replicate these new properties in your properties-local.xml:

    https://github.com/orbeon/orbeon-forms/commit/eeba30575670c7a7bf89fbc34d92f2ea9d7dca39

You’ll let us know if this works for you!

Regards,

-Erik