InsertFragmentOperation on XHTML5
Posted: Fri Feb 25, 2022 3:37 pm
Hello,
I created a custom framework to edit XHTML5 files, with OWA v24.
I created a toolbar button to insert a XML fragment with following code:
It looks like it's not working as it should.
In documentation, about schemaAware parameter, I can read:
How can I activate dialog displaying here?
Thanks for any help.
Regards,
Nicolas
I created a custom framework to edit XHTML5 files, with OWA v24.
I created a toolbar button to insert a XML fragment with following code:
Code: Select all
insertFragment(xml) {
this.actionsManager_.invokeOperation(
"ro.sync.ecss.extensions.commons.operations.InsertFragmentOperation",
{
fragment: xml,
schemaAware: 'true',
insertEvenIfInvalid: 'false'
},
function () {
console.log("Fragment inserted by click");
}
);
}
In documentation, about schemaAware parameter, I can read:
But, even schemaAware is true, if I insert my fragment at an invalid place dialog is never displayed and Oxygen automatically found the better location to insert it.Controlling if the insertion is schema aware or not. When is enabled and the fragments insertion is not allowed, a dialog will be shown proposing one of following solutions if they apply:
- insert the fragments inside a new element. The name of the element to wrap the fragments in is computed by analyzing the left or right siblings;
- split an ancestor of the node at insertion offset and insert the fragments between the resulted elements;
- insert the fragments somewhere in the proximity of the insertion offset(left or right without skipping content);
- insert at offset the plain text resulted after removing the mark-up;
- insert the fragments at insertion offset, even they are not allowed.
How can I activate dialog displaying here?
Thanks for any help.
Regards,
Nicolas