Subject:Simultaneous XSL and CSS Stylesheets? Author:Judy Hanson Date:12 Jan 2007 01:40 PM
My XSL stylesheet has some special styling features, such as multiple-level numbering for paragraph headings and inserting text at key points such as chapter labels, which works fine when rendered by my IE6 browser. However, my browser does not seem to support XSL-FO. So I've created a CSS stylesheet to handle most of the other styling.
The problem is that when both stylesheets are referenced in my XML document, the browser only applies the XSL formatting. The only way I can get any of the CSS styles to work is to completely remove the XSL stylesheet reference in the XML document, but then the multi-level paragraph numbering and other styles go away.
Is there a command or some other way to apply both stylesheets at the same time?
<volume num="1">
<title>OPERATION AND MAINTENANCE INSTRUCTIONS WITH PARTS BREAKDOWN ORGANIZATIONAL LEVEL COMMUNICATIONS DATA LINK SYSTEM (CDLS)</title>
<!-- Section 4.1 -->
<para0 tocentry="1">
<title>INTRODUCTION</title>
<para>This section provides a functional description of the Communications Data Link System (CDLS).</para>
<!-- Section 4.1.1 -->
<subpara1 tocentry="1">
<title>FUNCTIONAL DESCRIPTION OVERVIEW</title>
<para>This section provides an overall picture of the CDLS and lists all the functions of the signals and controls used by the system in a table.</para>
<!-- Section 4.1.1.1 -->
<subpara2 tocentry="1">
<title>Introduction</title>
<para>Figure 4-1 shows the relationship between the CDLS and the associated systems that provide the overall data recovery and analysis operation.</para>
<!-- Figure 4-1 -->
<para><figure tocentry="1" label="4-1">
<title>CDLS Relationship to Entire Data Operation</title>
<graphic boardno="g25810102" reprowid="5.5in"/>
</figure></para>
<para>Figure 4-2 shows the groups that comprise a CDLS and the interfaces between the groups.</para>
Subject:Simultaneous XSL and CSS Stylesheets? Author:Tony Lavinio Date:15 Jan 2007 01:07 PM
The problem is that you are including the part to apply the CSS
in your XSLT as a literal - but the HTML engine isn't styling the
XSLT, but it's output.
Make your XSLT generate the
<?xml-stylesheet type="text/css" href="docnavy-etm.css"?>
PI in the output, and then it _should_ be picked up.
Subject:Simultaneous XSL and CSS Stylesheets? Author:Judy Hanson Date:15 Jan 2007 01:14 PM
Sorry, but I'm new to the XML/XSL/CSS world. What do you mean by "Make your XSLT generate the
<?xml-stylesheet type="text/css" href="docnavy-etm.css"?>
PI in the output"? How do I do that?
Subject:Simultaneous XSL and CSS Stylesheets? Author:Judy Hanson Date:16 Jan 2007 01:00 PM
Sorry, but that doesn't seem to work. I copied and pasted your PI into my XSL stylesheet. When I placed it immediately after my <xsl:stylesheet...> declaration, I got an error message, "Keyword xsl:stylesheet may not contain xsl:processing-instruction." When I placed it immediately before my <xsl:stylesheet...> declaration, I got this error message:
Subject:Simultaneous XSL and CSS Stylesheets? Author:Tony Lavinio Date:16 Jan 2007 03:58 PM
Paste it right after the <xsl:template match="/docnavy-etm"> line.
You can only generate content from within templates, and you want it
to be the first thing written.
Subject:Simultaneous XSL and CSS Stylesheets? Author:Tony Lavinio Date:17 Jan 2007 05:21 PM
Can you try putting in the full path of the CSS document into the PI?
If you are previewing from Stylus Studio, then the base location is in
the temp directory, since that's where the temporary preview document
is located.
We can't try it here; we don't have all the pieces.
You could zip up the css, dtd, xslt and xml and send them along
to stylus-field-report (at) progress.com, and we could take a look
if this last step doesn't work.