docbook: Updated XSL Stylesheets


Previous by date: 7 Jul 2003 02:23:28 -0000 Re: Linux Dictionary Help Required, Binh Nguyen
Next by date: 7 Jul 2003 02:23:28 -0000 Re: Updated XSL Stylesheets, Emma Jane Hogbin
Previous in thread: 7 Jul 2003 02:23:28 -0000 Re: Updated XSL Stylesheets, Emma Jane Hogbin
Next in thread: 7 Jul 2003 02:23:28 -0000 Re: Updated XSL Stylesheets, Emma Jane Hogbin

Subject: Re: Updated XSL Stylesheets
From: David Horton ####@####.####
Date: 7 Jul 2003 02:23:28 -0000
Message-Id: <3F08DB27.10403@megsinet.net>

Emma Jane Hogbin wrote:

> On Tue, Jul 01, 2003 at 08:23:52PM -0500, David Horton wrote:
> 
>>Some day soon I would like to process the same Docbook XML document 
>>using both Norman Walsh's docbook-xsl and the tldp-xsl customizations 
>>and then put the html outputs through a validator.  This should 
>>determine which one is causing the HTML sloppiness.
> 
> 
> I've found that the problems are in the tldp-html-common.xsl file. I don't
> have enough vocabulary to describe the problem properly; however, I'll
> give it a try. David I'll email you my two revised files: styles.css and
> tldp-html-common.xsl -- I've added some comments to the top of the xsl
> file.
> 
> There are a number of elements that are specifically called in the
> tldp-html-common.xsl file: <pre>, author headings (calls <i>) and <meta>.
> These are the only elements that do not validate correctly because of an
> xmlns attribute that is not allowed in the (above) elements.
> 
> An example looks like this:
> 
> <xsl:template name="user.head.content">
>   <xsl:param name="node" select="."/>
>   <meta name="generator" content="Experimental LDP.XSL $Revision: 1.4 $"/>
>   <xsl:text>
>   </xsl:text>
>   <xsl:comment> Generated by LDP XSLT customization layer
>       based on Norman Walsh's DocBook XSL stylesheets.
>       More information at http://www.tldp.org/ </xsl:comment>
>   <xsl:text>
>   </xsl:text>
> </xsl:template>
> 
> NOTE: the <meta /> tag. This results in an incorrectly added xmlns in the
> final HTML document. I don't know enough about XSLT to know how to fix
> this, but there must be a way to print an element that is recognized
> somehow and therefore doesn't get an xmlns attribute added to it.
> 

I think that the trick to getting <meta>, <i> and <pre> to not have the 
xml namespace attributes is to replace them with <html:meta>, <html:i> 
and <html:pre> respectively.  My understanding is that this says to the 
XSLT processor, "hey, this is html coming up, not the default 
namespace."  The default namespace being xml in this case.  It may also 
be necessary to add a declaration of the html namespace at the beginning 
of the stylesheet, but I'm not positive on this.

> I propose competely removing the formatting changes for <pre>. All they
> were doing was adding a table with a background color. This can be done in
> the stylesheets. Another style sheet correctly adds a
> class="docbookattribute" if tldp-html-common.xsl <pre> section is removed, 
> which is good as specific classes can be styled from the style sheet if
> you want to have one type of <pre> that is different from another.
> 
> So that the formatting isn't lost the following should be added to the
> styles.css file:
> 	pre {
> 		background: #E0E0E0;
> 		margin: 0 5%;
> 		padding: 5%;
> 	}
> This duplicates the styling effects that were being achieved by the XSLT
> template which means the <table> formatting can be removed.
> 
> In the styles.css file I would reduce the margin to:
> 	body {
> 		margin: 5%; /* was 72pt; */
> 		font-family: sans-serif;
> 	}

I like the idea of getting rid of gratuitous <table>'s.  Do you think it 
would be better to do one CSS style for all <pre> tags or do many styles 
based on class?  That way it's easier to customize, like maybe "screen" 
gets a box drawn around it, but "programlisting" does not.  Or is that 
getting carried away?

Dave




Previous by date: 7 Jul 2003 02:23:28 -0000 Re: Linux Dictionary Help Required, Binh Nguyen
Next by date: 7 Jul 2003 02:23:28 -0000 Re: Updated XSL Stylesheets, Emma Jane Hogbin
Previous in thread: 7 Jul 2003 02:23:28 -0000 Re: Updated XSL Stylesheets, Emma Jane Hogbin
Next in thread: 7 Jul 2003 02:23:28 -0000 Re: Updated XSL Stylesheets, Emma Jane Hogbin


  ©The Linux Documentation Project, 2014. Listserver maintained by dr Serge Victor on ibiblio.org servers. See current spam statz.