Hide elements with content completion

Post here questions and problems related to editing and publishing DITA content.
Joerg
Posts: 3
Joined: Thu Oct 30, 2014 2:43 pm

Hide elements with content completion

Post by Joerg »

Hi,

Is it possible with the filter in the content completion to hide the <fig> element only within in <p>?
As both of them are block elements we don't want to let an author select the <fig> in a <p>.
Can this be done without an DTD change?

Best Regards
Joerg
Radu
Posts: 9417
Joined: Fri Jul 09, 2004 5:18 pm

Re: Hide elements with content completion

Post by Radu »

Hi Joerg,

This could be done with a document type customization.
If in the Oxygen Preferences->Document Type Association page you edit the DITA document type:

1) In the Author->Content Completion tab you can add the fig element to the list of elements to remove completely.
2) Then in the Author->Actions tab you can define a new action with the name fig which has an activation XPath (which you can set something like not(ancestor-or-self::p)) and calls an operation, you can choose an existing implementation called ro.sync.ecss.extensions.commons.operations.InsertFragmentOperation which inserts a certain XML fragment (for example <fig><title/></fig>).
3) Go back to the Author->Content Completion tab and add your new action to the list of content completion window entries.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Joerg
Posts: 3
Joined: Thu Oct 30, 2014 2:43 pm

Re: Hide elements with content completion

Post by Joerg »

Thanks a lot Radu,

This is a good procedure.

Best Regards,
Joerg
Post Reply