Skip to content

Data Mutation: Replace Instance with Insert Fails #25

@JDziurlaj

Description

@JDziurlaj

In testing XForms 1.1 spec, example B.12, Saxon-Forms fails with the following error:

Uncaught 
Object { message: "An empty sequence is not allowed as the value of variable $instance-with-insert", stack: "I@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4102:51\nerror/Od@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4694:67\nchoose/Od@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4686:487\ncheck/Od@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4686:29\ntreat/Od@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4736:115\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:322\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nchoose/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4435:41\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nD/Le/<@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:528\nD/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:501\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nD/Le/<@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:528\nD/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:501\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nD/Le/<@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:528\nD/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:501\nD/Le/<@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:528\nD/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:501\ncallT/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4434:374\nchoose/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4435:41\nD/Le/<@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:528\nD/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:501\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nchoose/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4435:41\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nD/Le/<@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:528\nD/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:501\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nD/Le/<@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:528\nD/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:501\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nD/Le/<@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:528\nD/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:501\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nD/Le/<@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:528\nD/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:501\nD/Le/<@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:528\nD/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:501\ncallT/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4434:374\nforEach/Le/<@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4438:110\nca.forEachItem@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4229:390\nforEach/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4438:80\nchoose/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4435:41\nD/Le/<@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:528\nD/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:501\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nchoose/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4435:41\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nD/Le/<@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:528\nD/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:501\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nD/Le/<@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:528\nD/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:501\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nD/Le/<@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:528\nD/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:501\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nD/Le/<@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:528\nD/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:501\nD/Le/<@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:528\nD/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:501\ncallT/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4434:374\nchoose/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4435:41\nchoose/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4435:41\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nforEach/Le/<@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4438:110\nca.forEachItem@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4229:390\nforEach/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4438:80\nlet/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4443:353\nD/Le/<@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:528\nD/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:501\nD/Le/<@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:528\nD/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4416:501\ncallT/Le@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4434:374\npush@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:4446:401\nbf@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:5054:330\nLb/<@http://localhost:9080/Saxon-JS-2.0/SaxonJS2.js:5052:192\n", name: "XError", code: "XTTE0570", xsltLineNr: "4318", xsltModule: "file:/C:/Users/John/Documents/GitHub/Saxon-Forms/src/saxon-xforms.xsl" }
SaxonJS2.js:4446:461
<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.12 -->
        <xforms:instance>
            <shoppingcart xmlns="">
                <item>
                    <product>SKU-0815</product>
                    <quantity>1</quantity>
                    <unitcost>29.99</unitcost>
                    <price>29.99</price>
                </item>
                <item>
                    <product>SKU-4711</product>
                    <quantity>3</quantity>
                    <unitcost>7.49</unitcost>
                    <price>22.47</price>
                </item>
            </shoppingcart>
        </xforms:instance>
        
        <xforms:instance id="prototypes">
            <prototypes xmlns="">
                <shoppingcart/>
            </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 nodeset="." origin="instance('prototypes')/shoppingcart"/>
            </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