Normal users are not supposed to do this. The intended audience for this appendix is consultants and local gurus. |
What follows is a description of what has been done to integrate the "Easy Profiling" add-on with DocBook (v4). Integrating the "Easy Profiling" add-on with other document types should be very similar.
File
contains a document template for a "profiling_install_dir
/docbook/template.profiles.profiles
" file which is specific to DocBook.
<profiles xmlns="http://www.xmlmind.com/xmleditor/schema/profiling" xmlns:prf="http://www.xmlmind.com/xmleditor/schema/profiling" class="com.xmlmind.xmleditext.profiling.docbook.DBProfileSet"> <attributes> <attribute name="???"> <value></value> </attribute> </attributes> <profile xml:id="???"> <description xml:space="preserve"></description> <attribute name="???"> <value></value> </attribute> </profile> </profiles>
The only part of this document template which is specific to DocBook is attribute class="com.xmlmind.xmleditext.profiling.docbook.DBProfileSet"
.
This attribute specifies that in the case of a DocBook document, abstract class com.xmlmind.xmleditext.profiling.ProfileSet
is implemented by class com.xmlmind.xmleditext.profiling.docbook.DBProfileSet
.
Class DBProfileSet
has been written in the Java™ programming language. It consists in just a few lines of declarative code because it extends abstract class com.xmlmind.xmleditext.profiling.XSLTProfileSet
.
public final class DBProfileSet extends XSLTProfileSet { ... @Override public char getDefaultSeparator() { return ';'; } protected String[] getProfilingAttributeNames() { return PROFILING_ATTRIBUTE_NAMES; } protected String getParameterFormat() { return "profile.%s"; } protected String getNameParameterFormat() { // A single custom profiling attribute is supported by the // DocBook XSLT stylesheets. Hence no "%d" in the format. return "profile.attribute"; } protected String getValueParameterFormat() { return "profile.value"; } }
File
contains these additional configuration elements:profiling_install_dir
/docbook/profiling.incl
<configuration xmlns="http://www.xmlmind.com/xmleditor/schema/configuration" xmlns:cfg="http://www.xmlmind.com/xmleditor/schema/configuration"> <include location="profiling:common/common.incl" /> <template location="template.profiles" name="Conditional Processing Profiles" category="DocBook" order="2000" /> <profiling> <class>com.xmlmind.xmleditext.profiling.docbook.DBProfileSet</class> </profiling> <menu label="-" insert="after _Demote"> <separator /> <menu label="Conditional Processin_g"> <item label="_Select Profile..." command="setProfiling" /> <item label="S_et Profiling Attributes..." command="setProfilingAttributes" /> </menu> </menu> </configuration>
File | |
This | |
This | |
This | |
First entry in the " | |
Second entry in the " |
The above file is referenced in the stock DocBook configuration (
) as follows:XXE_install_dir
/addon/config/docbook/docbook.xxe
<!-- Do not report an error if the "Easy Profiling" add-on has not been installed. --> <include location="---profiling:docbook/profiling.incl" />
The " | |
URL <rewriteURI uriStartString="profiling:" rewritePrefix="." /> |
File
contains the following declaration:profiling_install_dir
/common/profiling.imp
@extension "com.xmlmind.xmleditext.profiling.StyleSheetExtension";
The above CSS stylesheet extension allows the automatic addition of styles to elements having profiling attributes. It can also automatically add styles to elements matching the selected profile and/or to elements matching any “unselected” profile.
The above file is referenced in the stock DocBook CSS stylesheet (
) as follows:XXE_install_dir
/addon/config/docbook/css/docbook.css
/* Do not report an error if the "Easy Profiling" add-on has not been installed. */ @import url(---profiling:common/profiling.imp);