Skip to content

Cannot insert attributes to existing node #19

@JDziurlaj

Description

@JDziurlaj

Per XForms 1.1, I should be able to copy attributes into tags defined in the xf:model. However, when attempting this, I get the following error:

message: "Cannot write attribute (Q{}optional=true) after writing child nodes (level=3, start tag = demo:ingredient)...name: "XError", code: "XTDE0410", xsltLineNr: "2105", xsltModule: "file:/C:/Users/John/Documents/GitHub/Saxon-Forms/src/saxon-xforms.xsl" }

The trigger is defined as:

<xf:trigger>
	<xf:label>Make ingredient optional</xf:label>
	<xf:action ev:event="DOMActivate">
		<xf:insert context="." nodeset="demo:ingredients/demo:ingredient" origin="instance('i-optional')/@optional"/>
		<xf:setfocus control="edit-ingredient-repeat-input"/>
	</xf:action>
</xf:trigger>

Where i-optional is defined as

<xf:instance id="i-optional">
	<demo:ingredient optional="true"/>
</xf:instance>

See also https://gist.github.com/JDziurlaj/437ef86eaac38f4dc83c6bdef49d829e
Running SaxonJS 2.5

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