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: AW: [docbook-apps] Problems with including code samples using <xi:include>

I think that XInclude inserts these &#xD; characters. I tried to set the attribute “white-space-treatment” to “ignore-if-before-linefeed“ but it didn’t help.



Von: Bob Stayton [mailto:bobs@sagehill.net]
Gesendet: Mittwoch, 19.
August 2009 17:40
An: Mathias Schindler; DocBook Apps
Betreff: Re: [docbook-apps] Problems with including code samples using <xi:include>


Indeed, those &#xD; characters are the cause.  Those are carriage return characters.  What you don't see in your 'monospace.verbatim.properties' are the two properties contributed by the 'verbatim.properties' attribute-set in fo/param.xsl:


  <xsl:attribute name="white-space-collapse">false</xsl:attribute>
  <xsl:attribute name="white-space-treatment">preserve</xsl:attribute>

These preserve both the visible &#xD; carriage return and the invisible line feed that ends each line, so you get two line breaks, leaving a blank line.  Is there some reason the &#xD; characters need to be there since the invisible line feeds are retained?


Bob Stayton
Sagehill Enterprises



----- Original Message -----

Sent: Wednesday, August 19, 2009 7:00 AM

Subject: AW: [docbook-apps] Problems with including code samples using <xi:include>


Sorry for my late response but I was on vacation and forgot about this email L!


I use Saxon to resolve the XIncludes.


I think the programlisting stuff has something to do with this: http://services.renderx.com/lists/xep-support/4585.html .


The document with the resolved XIncludes looks like this:

<programlisting language="xml" linenumbering="unnumbered">

 &lt;?xml version="1.0" encoding="UTF-8"?&gt;&#xD;

&lt;?oxygen RNGSchema="schema/docbookxi.rng" type="xml"?&gt;&#xD;

&lt;!DOCTYPE book SYSTEM "schema/text.ent"&gt;&#xD;

&lt;chapter xml:id="generalinformation" xmlns="http://docbook.org/ns/docbook"&#xD;

    xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink"&gt;&#xD;

    &lt;title&gt;General Information&lt;/title&gt;&#xD;

    &lt;indexterm significance="normal"&gt;&#xD;



I think this entity(;&#xD;), causes the empty lines. I’m using XEP 4.16 to generate the PDF-Output and my “monospace.verbatim.properties“ attribute-set is defined as follows:

    <xsl:attribute-set name="monospace.verbatim.properties">

        <xsl:attribute name="font-size">8pt</xsl:attribute>

        <xsl:attribute name="font-family">Courier New</xsl:attribute>

        <xsl:attribute name="hyphenation-character">\</xsl:attribute>

        <xsl:attribute name="line-height">1.2</xsl:attribute>

        <xsl:attribute name="border-style">solid</xsl:attribute>

        <xsl:attribute name="border-color">#E6E5E5</xsl:attribute>

        <xsl:attribute name="border-width">.5pt</xsl:attribute>

        <xsl:attribute name="text-align">start</xsl:attribute>

        <xsl:attribute name="wrap-option">wrap</xsl:attribute>

        <xsl:attribute name="padding-left">0.10in</xsl:attribute>

        <xsl:attribute name="padding-right">0.10in</xsl:attribute>

        <xsl:attribute name="padding-bottom">0.10in</xsl:attribute>

        <xsl:attribute name="padding-top">0.10in</xsl:attribute>



Thanks in advance.


Greetings, Mathias


Von: Bob Stayton [mailto:bobs@sagehill.net]
Gesendet: Freitag, 31.
Juli 2009 01:47
An: Mathias Schindler; DocBook Apps
Betreff: Re: [docbook-apps] Problems with including code samples using <xi:include>



You didn't mention how you are resolving your XIncludes.  In the libxml2 kit, you could use xmllint --xinclude to generate a document with XIncludes resolved.  Then you could examine the resolved content to see what the XInclude step is doing.


The page break stuff is particularly strange, as para does not generally trigger a page break.


Bob Stayton
Sagehill Enterprises



----- Original Message -----

Sent: Wednesday, July 29, 2009 4:04 AM

Subject: [docbook-apps] Problems with including code samples using <xi:include>




I have included a DocBook XML file (encoded UTF-8) in a programlisting which in turn is placed in an example:


    <section xml:id="docbook">
<title>What is DocBook?</title>
<para>DocBook provides…</para>
<para>DocBook has some 400 tags...</para>

<title>A typical, simple DocBook document</title>
<programlisting language="xml">

    <xi:include href="userintroduction.xml" parse="text"><xi:fallback><phrase>userintroduction.xml not found.</phrase><phrase userlevel="internal"> Please check for black holes!</phrase></xi:fallback></xi:include>




In the PDF output (using XEP) I have the following two problems:


*Problem 1: The code lines are shown double-spaced instead of single (empty lines between the code lines) and the syntax highlighting does not work. Note that when copy-pasting the code into the DocBook document, both works fine.


*Problem 2: I get two page breaks which I did not bargain for. The PDF is structured as follows:


… blah the end of the last section.

What is DocBook?

DocBook provides…

(half a page empty)

(page break)

DocBook has some 400 tags…

(90% of the page empty)

(page break)

Example: A typical, simple DocBook document


I use XSLTHL for syntax highlighting. If you need more information please tell me.


Thank you in advance!


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