Constraining DITA 1.2 DTD in Oxygen

Post here questions and problems related to editing and publishing DITA content.
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Constraining DITA 1.2 DTD in Oxygen

Post by ann.jensen »

Hi,
I am interested in restricting the set of DITA elements available for our pilot of creating DITA based documentation in order to simplify the effort required by our content authors.
Can you advise if there are any tutorials/information out there that I can use for reference to do this? I am assuming that there are 2 steps required -
1. Restrict the DITA 1.2 DTD
2. Import the updated DTD into Oxygen Author

Any advice appreciated,
Regards,
Ann
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Constraining DITA 1.2 DTD in Oxygen

Post by Radu »

Dear Ann,

We do not have in our user's manual a chapter about DITA DTD specialization but there is a good tutorial about this written by Eliot Kimber (XML Guru, DITA consultant and member in the DITA OASIS committee):

http://www.xiruss.org/tutorials/dita-specialization/

After a DITA DTD specialization is constructed it can be distributed and installed as a DITA Open Toolkit plugin:

http://www.oxygenxml.com/doc/versions/1 ... ation.html

An alternative to DTD specialization is to use Oxygen's support for filtering out elements and not allowing end users to insert them.
If in the Oxygen Preferences->"Document Type Association" page you extend (or directly edit) the DITA document type association, in the Author->Content completion you have a Filter list in which you can add elements which should not be presented to the end user when editing.

http://www.oxygenxml.com/doc/versions/1 ... etion.html

A document type configuration can be shared with other users.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Re: Constraining DITA 1.2 DTD in Oxygen

Post by ann.jensen »

Hi Radu,

Thanks for you advice. I have tried the approach that you suggested i.e. Filtering out elements within Oxygen but they don't seem to be disappearing :? :?

I selected DITA from the Document Type Association list, selected Edit, Selected Author tab and added the following under 'Filter- Remove content completion items (titlealts, navtitle) checking all 4 checkboxes available.
When I create a new topic these elements are appearing in content completion and Elements View.

Is there another step that I am missing?
Thanks in advance,
Ann
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Constraining DITA 1.2 DTD in Oxygen

Post by Radu »

Hi Ann,

If you saved the DITA document type after editing it, that should have worked.
Could you try to edit it again just to see if your changes are there?
Also if you open a DITA topic, in the Window->Show View menu you can show the Properties view. That view should tell you what precise document type association is used for your DITA topic, it might be possible that you are using a custom DITA framework.

By the way, based on our discussion I also wrote a blog post about sharing such changes with your team members:

http://blog.oxygenxml.com/2015/08/docum ... aring.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Re: Constraining DITA 1.2 DTD in Oxygen

Post by ann.jensen »

Hi Radu,
>>>>If you saved the DITA document type after editing it, that should have worked. Could you try to edit it again just to see if your changes are there?
Yes the items I added to the 'Filter - Remove content completion items' are there and I can see that the Storage field point to 'C:\Oxygen XML Author 17\frameworks\dita\dita.framework'

>>>>Also if you open a DITA topic, in the Window->Show View menu you can show the Properties view. That view should tell you what precise document type association is used for your DITA topic, it might be possible that you are using a custom DITA framework.
I can see that the Document Type is DITA(C:\Oxygen XML Author 17\frameworks\dita\dita.framework)

>>>>By the way, based on our discussion I also wrote a blog post about sharing such changes with your team members:
Thanks for that :)

Which file gets updated when I added the items to the 'Filter - Remove content completion items' list?
Thanks,
Ann
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Constraining DITA 1.2 DTD in Oxygen

Post by Radu »

Hi Ann,
Which file gets updated when I added the items to the 'Filter - Remove content completion items' list?
If you did that by directly editing the DITA framework (and not by extension) then the configuration file:

C:\Oxygen XML Author 17\frameworks\dita\dita.framework

should have been updated.

By the way, your changes only affect editing DITA topics.
If you are actually editing DITA Maps, you should edit or extend the DITA Map framework configuration and do the same thing.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Re: Constraining DITA 1.2 DTD in Oxygen

Post by ann.jensen »

Hi Radu,
I can see the following in C:\Oxygen XML Author 17\frameworks\dita\dita.framework -

Code: Select all

<field name="removeItems">
<contextRemoveItem-array>
<contextRemoveItem>
<field name="targets">
<list>
<Integer>0</Integer>
<Integer>2</Integer>
<Integer>1</Integer>
<Integer>3</Integer>
</list>
</field>
<field name="renderName">
<String>titlealts</String>
</field>
</contextRemoveItem>
<contextRemoveItem>
<field name="targets">
<list>
<Integer>0</Integer>
<Integer>2</Integer>
<Integer>1</Integer>
<Integer>3</Integer>
</list>
</field>
<field name="renderName">
<String>navtitle</String>
</field>
</contextRemoveItem>
<contextRemoveItem>
<field name="targets">
<list>
<Integer>0</Integer>
<Integer>2</Integer>
<Integer>1</Integer>
<Integer>3</Integer>
</list>
</field>
<field name="renderName">
<String>searchtitle</String>
</field>
</contextRemoveItem>
<contextRemoveItem>
<field name="targets">
<list>
<Integer>0</Integer>
<Integer>2</Integer>
<Integer>1</Integer>
<Integer>3</Integer>
</list>
</field>
<field name="renderName">
<String>proptype</String>
</field>
</contextRemoveItem>
<contextRemoveItem>
<field name="targets">
<list>
<Integer>0</Integer>
<Integer>2</Integer>
<Integer>1</Integer>
<Integer>3</Integer>
</list>
</field>
<field name="renderName">
<String>propdesc</String>
</field>
</contextRemoveItem>
<contextRemoveItem>
<field name="targets">
<list>
<Integer>0</Integer>
<Integer>2</Integer>
<Integer>1</Integer>
<Integer>3</Integer>
</list>
</field>
<field name="renderName">
<String>propvalue</String>
</field>
</contextRemoveItem>
<contextRemoveItem>
<field name="targets">
<list>
<Integer>0</Integer>
<Integer>2</Integer>
<Integer>1</Integer>
<Integer>3</Integer>
</list>
</field>
<field name="renderName">
<String>prereq</String>
</field>
</contextRemoveItem>
<contextRemoveItem>
<field name="targets">
<list>
<Integer>0</Integer>
<Integer>2</Integer>
<Integer>1</Integer>
<Integer>3</Integer>
</list>
</field>
<field name="renderName">
<String>context</String>
</field>
</contextRemoveItem>
<contextRemoveItem>
<field name="targets">
<list>
<Integer>0</Integer>
<Integer>2</Integer>
<Integer>1</Integer>
<Integer>3</Integer>
</list>
</field>
<field name="renderName">
<String>tutorialinfo</String>
</field>
</contextRemoveItem>
<contextRemoveItem>
<field name="targets">
<list>
<Integer>0</Integer>
<Integer>2</Integer>
<Integer>1</Integer>
<Integer>3</Integer>
</list>
</field>
<field name="renderName">
<String>cite</String>
</field>
</contextRemoveItem>
<contextRemoveItem>
<field name="targets">
<list>
<Integer>0</Integer>
<Integer>2</Integer>
<Integer>1</Integer>
<Integer>3</Integer>
</list>
</field>
<field name="renderName">
<String>dd</String>
</field>
</contextRemoveItem>
<contextRemoveItem>
<field name="targets">
<list>
<Integer>0</Integer>
<Integer>2</Integer>
<Integer>1</Integer>
<Integer>3</Integer>
</list>
</field>
<field name="renderName">
<String>ddhd</String>
</field>
</contextRemoveItem>
</contextRemoveItem-array>
</field>
So my changes are being propagated to the dita.framework file. However, when I create a new topic I can still add the titlealts element after the title element. I see it in content completion and in the elements view. So, it appears that the code added to dita.framework above is not being used/interpreted.
Do you have any idea how/why this might happen?
Thanks again,
Ann
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Constraining DITA 1.2 DTD in Oxygen

Post by Radu »

Hi Ann,

There might be an explanation for this.
The filters list works only in the Author editing mode. So if you are using the Text editing mode, the filters are not applied there.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Re: Constraining DITA 1.2 DTD in Oxygen

Post by ann.jensen »

Ok, thanks Radu, that explains it.
I have since figured out how to accomplish it using constraint modules.
Regards,
Ann
brzeski
Posts: 4
Joined: Tue Oct 13, 2015 6:23 pm

Re: Constraining DITA 1.2 DTD in Oxygen

Post by brzeski »

Hi, Radu

Thanks for your instructions on the constraining the Elements list. Very helpful.

My question is, how do I do the same to the Attributes pane? If there are attributes we don't want our authors to use, how can I constrain the options?

Thank you
Corinne
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Constraining DITA 1.2 DTD in Oxygen

Post by Radu »

Hi Corinne,

In Oxygen 18.0 we added support to defined allowed elements and attributes in a special XML configuration file which is delivered with the DITA framework. So maybe this topic will help:

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

For older Oxygen versions we have a Java extension which could call our API to hide certain attributes in the Attributes view.

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