--- Eric van der Vlist <[EMAIL PROTECTED]> wrote:

> When I attach a schema to my XForms form, I get this ugly excpetion when
> the instance isn't valid: [...]

Eric, I wrote a test case (attached, will be added to the tests-xforms.xml
series of tests), but was unable to reproduce this. Could you send me some
code that I could use to reproduce the problem you are experimenting?

> What can be the reason for that and is it possible to perform a schema
> validation using the same decoration mechanism that is used with
> xforms:bind constraints?

Using a schema works as if you had <xforms:bind> elements, with the
exception that only the first invalid node in the instance is marked as
invalid. This is an annoying restriction of the XML Schema validator we
are using (see bug http://tinyurl.com/5xsyn).

Alex
    <test description="Schema validation" name="oxf:pipeline" only="true">
        <input name="config">
            <p:config xmlns:oxf="http://www.orbeon.com/oxf/processors";
                    xmlns:xxforms="http://orbeon.org/oxf/xml/xforms";>
                <p:param name="instance" type="output"/>
                <p:processor name="oxf:xforms-input">
                    <p:input name="model">
                        <xforms:model schema="form.xsd">
                            <xforms:instance>
                                <instance>
                                    <a>35</a>
                                    <b>-42</b>
                                    <c>x</c>
                                    <d/>
                                </instance>
                            </xforms:instance>
                        </xforms:model>
                    </p:input>
                    <p:input name="request"><request><parameters/></request></p:input>
                    <p:input name="filter"><params/></p:input>
                    <p:input name="matcher-result"><result/></p:input>
                    <p:output name="data" id="instance"/>
                </p:processor>
                <!-- Remove error message added by validator that might 
                     change from one version to the other  -->
                <p:processor name="oxf:xslt-2.0">
                    <p:input name="data" href="#instance"/>
                    <p:input name="config">
                        <xsl:stylesheet version="2.0">
                            <xsl:import href="oxf:/oxf/xslt/utils/copy.xsl"/>
                            <xsl:template match="@xxforms:error"/>
                        </xsl:stylesheet>
                    </p:input>
                    <p:output name="data" ref="instance"/>
                </p:processor>
            </p:config>
        </input>
        <output name="instance">
            <instance>
                <a>35</a>
                <b xxforms:valid="false">42</b>
                <c>x</c>
                <d/>
            </instance>
        </output>
    </test>

Reply via email to