Page 1 of 1

Enforcing the generation of xml:id attributes in DocBook content

Posted: Tue Sep 19, 2017 6:53 pm
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>

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

Posted: Wed Sep 20, 2017 8:43 am
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