This is the mail archive of the docbook@lists.oasis-open.org mailing list for the DocBook project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [docbook] Embedding XML schema into DocBook document


Jirka's solution will wrap the lines as he says.  But I'm curious about what
people expect when lines in code listings wrap.  The FO formatter will wrap
the lines back to the left margin.  But most people want their code listings
to wrap to the current indent level in the code.  That isn't a feature of
XSL-FO that I know of.  It would work if each line were put inside its own
fo:block, and the block's margin-left set to the appropriate indent level in
the code listing.   In a monospace font, I think the indent width could be
computed from the number of leading spaces? Has anyone tried to do that?

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net


----- Original Message ----- 
From: "Jirka Kosek" <jirka@kosek.cz>
To: "Allison Bloodworth" <abloodworth@berkeley.edu>
Cc: <docbook@lists.oasis-open.org>
Sent: Monday, October 04, 2004 12:38 PM
Subject: Re: [docbook] Embedding XML schema into DocBook document


Allison Bloodworth wrote:

> I didn't find an answer to what I would think would be a common question
in the archives...
>
> I want to embed an XML schema in a DocBook document and have it displayed
in the output (pdf & html) as a properly-formatted XML schema. I don't think
the "programlisting" or "literallayout" elements are right for what I want
to do because many lines of my XML schema are very long and run off the page
if they are not wrapped. I don't want to have to go through the schema line
by line and manually enter line breaks. Is there an element which not try to
translate the XML schema into part of the DocBook document, but will enter
line breaks where appropriate?

You can add the following code into your XSL customization layer in
order to permit wrapping of long lines inside programlisting.

<xsl:attribute-set name="monospace.verbatim.properties"
use-attribute-sets="verbatim.properties monospace.properties">
   <xsl:attribute name="wrap-option">wrap</xsl:attribute>
</xsl:attribute-set>

-- 
------------------------------------------------------------------
   Jirka Kosek     e-mail: jirka@kosek.cz     http://www.kosek.cz
------------------------------------------------------------------
   Profesionální ¹kolení a poradenství v oblasti technologií XML.
      Podívejte se na ná¹ novì spu¹tìný web http://DocBook.cz
        Podrobný pøehled ¹kolení http://xmlguru.cz/skoleni/
------------------------------------------------------------------



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]