orbeon / orbeon-forms

Orbeon Forms is an open source web forms solution. It includes an XForms engine, the Form Builder web-based form editor, and the Form Runner runtime.
http://www.orbeon.com/
GNU Lesser General Public License v2.1
512 stars 220 forks source link

Incorrect error "Prefix xis has not been declared" #3747

Open avernet opened 5 years ago

avernet commented 5 years ago

To reproduce, run the following XForms:

<xh:html xmlns:fr="http://orbeon.org/oxf/xml/form-runner" xmlns:xis="http://art-decor.org/ns/xis" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xh="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events">
    <xh:head>
        <xh:title>orbeon-2018-1-fr-namespace-issue</xh:title>
        <xf:model id="repro">
            <xf:instance id="test">
                <tests xmlns:xis="http://art-decor.org/ns/xis">
                    <test>1</test>
                    <test>2</test>
                </tests>
            </xf:instance>
        </xf:model>
    </xh:head>
    <xh:body>
        <xh:h3>TEST</xh:h3>
        <fr:tabview>
            <fr:tab>
                <fr:label ref="concat('TESTS (',count(instance('test')/xis:test),')')"/>
            </fr:tab>
        </fr:tabview>
    </xh:body>
</xh:html>

+1 from user

ebruchez commented 5 years ago

For the record, we consider fr:tabview as deprecated since we have fr:tabbable now, and Form Builder uses that.

ebruchez commented 5 years ago

Here is the code which evaluates the label:

<xf:output xxbl:scope="outer">
    <xsl:copy-of select="$label/(@model | @context | @ref | @bind | @value | node())"/>
</xf:output>

The result in this case would be:

<xf:output
    xxbl:scope="outer"
    ref="concat('TESTS (',count(instance('test')/xis:test),')')"/>

We switch to the outer scope, which should include the in-scope namespaces.

ahenket commented 5 years ago

We will have a mixed Orbeon 3.9 and Orbeon ... environment for some time to come. We try to maintain 1 code base for both versions for a grace period. This would mean keeping tabview around for some time to come.

I appreciate that you consider tabview deprecated, but unfortunately it broke in the 2018 edition. It still works fine in 2017. Could you at least fix what broke so we can still use it?

I tried using fr:tabbable, but as it is not documented, all I could think of is rename fr:tabview to fr:tabbable in the XForm. This gives me the first tab as expected, but I cannot get to the second tab of the two. Clicking it yields nothing. If fr:tabbable is to be a true replacement, I should be able to get comparable results to fr:tabview, I reckon

image
ebruchez commented 5 years ago

We can certainly look into it.