Skip to content

Data Mutation: Insert Element into Non-Contiguous, Heterogeneous Nodeset Silently Fails #27

@JDziurlaj

Description

@JDziurlaj

In testing XForms 1.1 spec, example B.15, Saxon-Forms silently fails (i.e. instance is unchanged).

XForms:

<xforms:xform xmlns:rest="http://exquery.org/ns/restxq" xmlns:ev="http://www.w3.org/2001/xml-events"
    xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xforms="http://www.w3.org/2002/xforms"
    xmlns:demo="urn:saxon-xforms:demo">
    <xforms:model id="m-recipes">
        <!-- B.15 -->
        <xforms:instance>
            <document xmlns="">
                <chapter>
                    <header>Lorem ipsum</header>
                    <paragraph>Lorem ipsum verterem voluptaria ...</paragraph>
                    <diagram>Exemplum 1</diagram>
                    <diagram>Exemplum 2</diagram>
                    <paragraph>Primis abhorreant delicatissimi ...</paragraph>
                </chapter>
                <chapter>
                    <header>Lorem ipsum</header>
                    <diagram>Exemplum 3</diagram>
                </chapter>
            </document>
        </xforms:instance>
        
        <xforms:instance id="prototypes">
            <prototypes xmlns="">
                <chapter/>
                <header/>
                <paragraph/>
                <diagram/>
            </prototypes>
        </xforms:instance>
        <!--do not change -->
        <xforms:submission id="test" ref="." instance="hello"/>
    </xforms:model>
    <div id="content">
        <xforms:trigger>
            <xforms:label>Test it</xforms:label>
            <xforms:action ev:event="DOMActivate">
                <xforms:insert context="item[2]" origin="../item[1]/@rating"/>
                <xforms:delete nodeset="item[1]/@rating"/>
            </xforms:action>
        </xforms:trigger>
        <xforms:submit submission="test">
            <xforms:label>Export Subset</xforms:label>
        </xforms:submit>
    </div>
</xforms:xform>

Note that I am not using the SEF included with the repo; however, I am using a newly compiled version from an unmodified saxon-xforms.xsl using Oxygen's Compile XSL stylesheet for Saxon (Oxygen 25.0, 2022101006) and running using SaxonJS-2.5 on Firefox 108.0 (Windows)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions