maurizio codogno wrote:
> Now that I have managed to convert my old document to DocBook,
> I am still at a loss about how to modify both XSLT and CSS location.
>
> If I edit <XXE_distrib_directory>/config/docbook/xslMenu.incl , I
> am able to use a different stylesheet for the output. I think I
> grasped how to modify <XXE_local_dir>/confing/mydocbook.xxe to do
> it in a cleaner way.
>
> But I still do not know how to modify the XSLT files to output
> the HTML I need. For example, if I have <emphasis role="strong"> in
> the source, I will get as output a <span class="strong"> which I may
> style. But what if I want to add a role attribute to another
> tag?
* Quick and dirty method:
-------------------------
[1] Edit <XXE_install_dir>/config/docbook/xsl/css/html.css using a text
editor.
[2] Add some CSS styles, example (for <emphasis role="flashy">):
---
span.flashy {
background-color: yellow;
color: red;
}
---
* Clean, maintenable, method:
-----------------------------
[1] Create a DocBook customization as explained in
http://www.xmlmind.com/xmleditor/_distrib/docs/configure/ch04.html
[2] In your custom XXE configuration file for DocBook, redefine some of
the process commands found in
<XXE_distrib_directory>/config/docbook/xslMenu.incl.
For example, you may want to redefine:
---
<command name="docb.toHTML">
<process>
<mkdir dir="resources" />
<!-- add attribute selection="true" to copyDocument if you want
to be able to process explicitely selected element -->
<copyDocument to="__doc.xml">
<resources match="(https|http|ftp)://.*" />
<resources match=".+" copyTo="resources" />
</copyDocument>
<mkdir dir="callouts" />
<copyProcessResources
resources="@xsl/images/callouts/gif_callouts.list"
to="callouts" />
<copyProcessResources resources="xsl/css/html.css"
to="html.css" />
<transform stylesheet="xsl/html/chunk.xsl"
file="__doc.xml" to="__doc.html" >
<parameter name="base.dir">%W%S</parameter>
<parameter name="chunk.first.sections">1</parameter>
<parameter name="chunk.section.depth">1</parameter>
<parameter name="toc.section.depth">3</parameter>
<parameter name="section.autolabel">1</parameter>
<parameter name="callout.graphics">1</parameter>
<parameter name="callout.graphics.path">callouts/</parameter>
<parameter name="callout.graphics.extension">.gif</parameter>
<parameter name="html.stylesheet">html.css</parameter>
<parameterGroup name="docb.toHTML.transformParameters" />
</transform>
<!-- The real HTML file is index.html -->
<delete files="__doc.*" />
<upload base="%0/">
<copyFiles files="*.*" toDir="." />
<copyFiles files="resources/*" toDir="resources" />
<copyFiles files="callouts/*" toDir="callouts" />
</upload>
</process>
</command>
---
in order to make it point to your *custom* XSL and CSS style sheets (and
not to stock <XXE_distrib_directory>/config/docbook/xsl/html/chunk.xsl
and <XXE_distrib_directory>/config/docbook/xsl/css/html.css).
Your *custom chunk.xsl* can import the whole stock
<XXE_distrib_directory>/config/docbook/xsl/html/chunk.xsl
by simply adding this line at the beginning of your file.
---
<xsl:import href="xxe-config:docbook/xsl/html/chunk.xsl"/>
---