There are times when working with XML documents that it would be nice
to be able to style the document directly. To do this with CSS here is
a recipe that works with Internet Explorer, Firefox and the Arbortext
Epic Editor.
- Add a css stylesheet reference in your XML document.
<?xml-stylesheet
href="docbook.css" type="text/css"?>
|
- Modify you XML document to hide the doctype declaration in a
comment. This stops IE from looking for it but still allows Epic to
find it. If you are only interested in making it work with Firefox you
can skip this step.
<?xml version="1.0"
encoding="utf-8"?>
<?xml-stylesheet href="docbook.css" type="text/css"?>
<!-- Fragment document type declaration subset:
Arbortext, Inc., 1988-2004, v.4002
<!DOCTYPE set PUBLIC "-//Arbortext//DTD DocBook XML V4.0//EN"
"axdocbook.dtd">
-->
|
- Set writenonasciichar=char in Epic and save the XML
document. This writes all of the character entities that may be present
out as characters so the web browsers don't complain about not being
able to find the reference. This needs to either be set every time you
edit the instance in Epic or via an ACL package.
- Create your CSS. A small sample docbook.css:
book {
}
book>title {
display:block;
font-size:3em;
color:inherit;
background:inherit;
font-weight:bold;
}
legalnotice{
font-weight:bold;
}
title {
display:block;
font-size:1.3em;
color:inherit;
background:inherit;
font-weight:bold;
}
para {
display:block;
padding: 20px;
}
|
CA