Prevent deletion of section

<oXygen/> general issues.
JulieP
Posts: 12
Joined: Sat May 30, 2015 2:18 am

Prevent deletion of section

Post by JulieP » Wed Jan 15, 2020 9:13 am

Is there a way to prevent the deletion of a section or paragraph?

Radu
Posts: 6980
Joined: Fri Jul 09, 2004 5:18 pm

Re: Prevent deletion of section

Post by Radu » Wed Jan 15, 2020 12:05 pm

Hi Julie,

If for example you mark that XML element with a certain attribute:

Code: Select all

<p outputclass="read-only">Oil should be changed every 6000 kilometers.</p>
you can set the element as read-only from the CSS:

Code: Select all

p[outputclass='read-only'] {
  -oxy-editable:false;
}
but the element will have read-only contents, you will still be able to delete it from the Outline.
If you want something more probably you can use our Java based API to implement an AuthorDocumentFilter:

https://www.oxygenxml.com/InstData/Edit ... ilter.html

or with a schema aware editing handler:

https://www.oxygenxml.com/doc/versions/ ... ndler.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply