Evaluate Node Collection of Selection
Posted: Tue Jun 13, 2017 9:02 pm
Hello,
I would like to prevent the deletion of <title> elements (and their content) within an xml document if the <title> element has an attribute of 'hTitle'. Thus far I have managed to prevent the deletion of element content by overidding the 'delete' method in an extension class of AuthorDocumentFilter; within this overridden 'delete' method I check the node at the caret and stop the content deletion if the 'hTitle' attribute exist. This works great if the user attempts to delete content at the cursor position.
However, when the user attempts a delete operation on a selection spanning a collection of elements I am unable to find a working approach to check the element content of the selection and stop the deletion operation. Is there a class method to access the element content of a selection? I tried to use getFullySelectedNode form WSAuthorEditorPageBase in hopes that I could parse the children of that node, but I wan't able to make that work.
Any advice will be greatly appreciated.
Thanks,
Jacob
I would like to prevent the deletion of <title> elements (and their content) within an xml document if the <title> element has an attribute of 'hTitle'. Thus far I have managed to prevent the deletion of element content by overidding the 'delete' method in an extension class of AuthorDocumentFilter; within this overridden 'delete' method I check the node at the caret and stop the content deletion if the 'hTitle' attribute exist. This works great if the user attempts to delete content at the cursor position.
However, when the user attempts a delete operation on a selection spanning a collection of elements I am unable to find a working approach to check the element content of the selection and stop the deletion operation. Is there a class method to access the element content of a selection? I tried to use getFullySelectedNode form WSAuthorEditorPageBase in hopes that I could parse the children of that node, but I wan't able to make that work.
Any advice will be greatly appreciated.
Thanks,
Jacob