Page 1 of 1

Docbook XML to (X)HTML with CSS Stylesheet

Posted: Tue Jan 31, 2012 1:26 pm
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!

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

Posted: Tue Jan 31, 2012 1:52 pm
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

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

Posted: Tue Jan 31, 2012 2:12 pm
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.

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

Posted: Tue Jan 31, 2012 2:46 pm
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