OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RE: [docbook-apps] RE: Adding line breaks to HTML source files


Jennifer,

Rob's excellent answer provides both the fix and a warning about the fix. To amplify the warning, we found that the indent=yes option had a tendency to break our code examples inside <programlisting> elements in subtle but unacceptable ways.

Our solution was to leave indent in its default state of indent=no, and then post-process the generated HTML with tidy. This only adds seconds to the overall document build time, and the results are excellent. 

You can find versions of the tidy utility for several operating systems at http://tidy.sourceforge.net/.


-----Original Message-----
From: Cavicchio_Rob@emc.com [mailto:Cavicchio_Rob@emc.com] 
Sent: Friday, April 03, 2009 12:15 PM
To: jennifer@uncharted-worlds.org; docbook-apps@lists.oasis-open.org
Subject: [docbook-apps] RE: Adding line breaks to HTML source files

Jennifer Moore [mailto:jennifer@uncharted-worlds.org] wrote:

> Not a major problem, but something I was puzzling over:  how 
> do the line 
> breaks get into HTML source files generated from DocBook XML?  (or 
> indeed any XML I suppose.)


This is handled automatically by the XSLT processor. There is an
attribute on <xsl:output> and <xsl:result-document> called "indent" that
can be set to "yes" or "no". If you set it to "yes", the processor adds
whitespace to make the code more readable. But as you might imagine,
this can cause problems with HTML content that's intended to be laid out
as is--mainly the contents of the <pre> element, which is often used to
display code.

The slegdehammer alternative to getting more line breaks in your code
might be to force them in with an <xsl:text> element:

	<xsl:text>&#A;</xsl:text>


*************************
Rob Cavicchio
Principal Technical Writer
EMC Captiva
EMC Corporation
10145 Pacific Heights Boulevard, 6th Floor
San Diego, CA 92121-4234

P: (858) 320-1208
F: (858) 320-1010
E: Cavicchio_Rob@emc.com

The opinions expressed here are my personal opinions. Content published
here is not read or approved in advance by EMC and does not necessarily
reflect the views and opinions of EMC.
 

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]