Docbook XML to (X)HTML with CSS Stylesheet

DKeyes
Posts: 9
Joined: Tue Jan 31, 2012 1:13 pm

Docbook XML to (X)HTML with CSS Stylesheet

Post by DKeyes »

Hello,
we´re trying to convert a Docbook document to HTML with the Oxygen XML Editor using CSS. We already have a XSL stylesheet for PDF output.

What we are trying to do is to import or reference our css stylesheet into the xsl stylesheet needed for the transformation process.

An abstract of our XSL stylesheet:

Code: Select all

    <xsl:template name="user.head.content">
<style type="text/css">
&css;
</style>
</xsl:template>
The generated output in the HTML file seems to be correct ( most formats are used),

Code: Select all

<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Book Template Title</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"><style type="text/css">
@import "docbook.css";

/*RapidRep style sheet definition*/
/*General*/
body_text{
font-family: Ariel;
font-size: 10pt;
line-height: 100%;
text-align: left;
padding-bottom: 12pt;
}
but our setttings don´t appear right. In this case, body_text appears in red, but not in black as it supposed to.

<body_text>test</body_text>

If we´re trying to manually adjust the HTML file, the formats are recognized. Nevertheless, Oxygen doesn´t transform the the formats correctly. Could you help me with a possible configuration or explaination?

Thanks!
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Docbook XML to (X)HTML with CSS Stylesheet

Post by Radu »

Hi,

I do not quite understand.
Could you give me a complete HTML sample?

So in your customized <style> you import a "docbook.css" which probably is located in the same location as the output HTML file, right?
What does the docbook.css contain? Additional styling for the HTML elements?

Then you use a CSS selector like:

Code: Select all


body_text{
.....
}
Such a CSS selector would match elements named <body_text> which would appear in the HTML output. Is this right? Do you have in the HTML output such elements?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
DKeyes
Posts: 9
Joined: Tue Jan 31, 2012 1:13 pm

Re: Docbook XML to (X)HTML with CSS Stylesheet

Post by DKeyes »

Hi,

we import a custom css file into the stylesheet for tranforming into HTML.This css file is located in the same folder with the other xsl stylesheets and css files.
The docbook.css is imported via

Code: Select all

@import "docbook.css";
into our custom css file.

What i tried to explain was, that even though we were able to import the custom css file into our stylesheet, the ouptut wasn´t right. We didn´t receive any error messages but we could see that the stylesheet "accessed" the css stylesheet.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Docbook XML to (X)HTML with CSS Stylesheet

Post by Radu »

Hi,
We didn´t receive any error messages but we could see that the stylesheet "accessed" .....
I do not understand what you mean by this, what does "stylesheet" mean in this context?
Do you mean XSLT stylesheet or do you mean the small <script> embedded in the HTML which imported the "docbook.css"?

Please try to post the content of a small and complete HTML sample file.

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