Enforcing the generation of xml:id attributes in DocBook content

dcramer
Posts: 163
Joined: Sat Aug 28, 2010 1:23 am

Enforcing the generation of xml:id attributes in DocBook content

Post by dcramer »

In the DocBook framework, the menu DocBook5->ID Options... allows the user to specify a pattern to use for automatically adding xml:id attributes to a specified list of elements. I would like to control these settings for our users in our customization of that framework. It appears that the preferences related to this are stored in ~/Library/Preferences/com.oxygenxml/oxyOptionsSa<version>.xml (see code sample below).

What would be the correct way to define these ahead of time in the framework so that my settings are pre-defined? I'll then remove ID Options... from the menu so they have no choice but to do my bidding, bwahahaha...

Regards,
David

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<serialized version="18.1" xml:space="preserve">
<serializableOrderedMap>
<entry>
<String>DocBook.5.document.type.auto.generate.id.elements.active</String>
<String>true</String>
</entry>
<entry>
<String>DocBook.5.document.type.filter.ids.on.copy</String>
<String>true</String>
</entry>
<entry>
<String>DocBook.5.document.type.generate.id.for.elements</String>
<String>section,chapter,preface,table,appendix,figure,informalfigure,</String>
</entry>
<entry>
<String>DocBook.5.document.type.generate.ids.pattern</String>
<String>${localName}-${uuid}</String>
</entry>
Radu
Posts: 9431
Joined: Fri Jul 09, 2004 5:18 pm

Re: Enforcing the generation of xml:id attributes in DocBook content

Post by Radu »

Hi David,

The default values for that dialog's settings reside in the file OXYGEN_INSTALL_DIR\frameworks\docbook\resources\idGenerationDefaultOptionsDB5.xml.
If users manually change those settings in the dialog in any way indeed the settings will then be saved in the Oxygen general preferences XML document that you mentioned.

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