Richard Hamilton | 1 Aug 01:07 2008

Placement of indexterms

I've been indexing a book in DocBook 5.0 and am running into something
strange.  What I would like to do is to mark an entire section as a
range in the index.  So, I have something like this:

<section>
  <title>Using the Internet</title>
  <indexterm class="startofrange" xml:id="idx.chap.using.web">
    <primary>Internet</primary>
  </indexterm>
	... content ...
  <indexterm class="endofrange" startref="idx.chap.using.web"/>
</section>

This works fine if there are no subsections in "... content ...". But,
if there are, the <indexterm> at the end is invalid.  That is,
<indexterm> is allowed inside a section *before* any sub-section, but
not after.  The only way to make this example parse is to place the
closing <indexterm> at the end of the last, inner-most section.
Confusing enough?  Here is a better(?) example:

<section>  ...
   <indexterm .../> <!-- A OK-->
   <section> ...
      <section> ...
      </section>
      <section> ...
        <indexterm .../> <!-- B OK-->
      </section>
      <indexterm .../> <!-- C BAD-->
   </section>
(Continue reading)

Andreas Peter | 5 Aug 19:08 2008
Picon

source code and docbook

Hello DocBook users,

I am currently writing my thesis using DocBook. The document contains a 
lot of xml source code. Actually I use the element programlisting for 
source code and indent the source code manually.

My question: are there any possibilities to indent source code 
automatically?

Thanks in advance,
Andreas
Peter Desjardins | 5 Aug 19:29 2008
Picon

Re: source code and docbook

> My question: are there any possibilities to indent source code
> automatically?

What tool are you using to author your DocBook content?

I am including XML source code in programlistings also.  I've got
Oxygen to format the code and then I paste it into a programlisting
using XMLMind.  XMLMind preserves the indenting and it handles all the
escaping of XML tags.

Is that what you meant?

Peter
Andreas Peter | 5 Aug 20:39 2008
Picon

Re: source code and docbook

I use Oxygen, too. I do the same steps as you described. After searching 
the web I found the possibility to include source code using XInclude. 
That works really great. I going to love DocBook :-)

Peter Desjardins schrieb:
>> My question: are there any possibilities to indent source code
>> automatically?
>>     
>
> What tool are you using to author your DocBook content?
>
> I am including XML source code in programlistings also.  I've got
> Oxygen to format the code and then I paste it into a programlisting
> using XMLMind.  XMLMind preserves the indenting and it handles all the
> escaping of XML tags.
>
> Is that what you meant?
>
> Peter
>   
Andreas Peter | 5 Aug 21:59 2008
Picon

indent of first line when using xinclude

Hello DocBook users,

when I include source code using XInclude the first line has an indent. 
I need a flush. Is there a possible solution for this?

Thanks in advance,
Andreas
Peter Desjardins | 5 Aug 22:06 2008
Picon

Re: source code and docbook

One other method you might consider is the textdata element.  I use
this to include entire files of code.

<inlinemediaobject>
  <textobject>
    <textdata fileref="path/to/file.xml" />
  </textobject>
</inlinemediaobject>

http://www.sagehill.net/docbookxsl/ExternalCode.html

Peter
Jirka Kosek | 5 Aug 22:51 2008
Picon

Re: indent of first line when using xinclude

Andreas Peter wrote:

> when I include source code using XInclude the first line has an indent. 
> I need a flush. Is there a possible solution for this?

You probably have whitespace before <xi:include> element and this 
whitespace is preserved in "verbatim" elements like programlisting. Use 
something like:

<programlisting><xi:include .../></programlisting>

--

-- 
------------------------------------------------------------------
   Jirka Kosek      e-mail: jirka <at> kosek.cz      http://xmlguru.cz
------------------------------------------------------------------
        Professional XML consulting and training services
   DocBook customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
  OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
------------------------------------------------------------------

George Cristian Bina | 6 Aug 09:49 2008

Re: source code and docbook

Hi Peter,

Just a couple of clarifications.

 > I am including XML source code in programlistings also.  I've got
 > Oxygen to format the code and then I paste it into a programlisting
 > using XMLMind.

If you paste XML code in the Author mode (the visual editing mode in 
oXygen) inside a programlisting element then oXygen will automatically 
consider that as text and will escape the tags.
In Text mode (when you edit the XML source directly) we provide an 
"Escape selection" action to perform escaping on the current selection. 
You can find it in the contextual menu (right click on Windows, 
CTRL+click on Mac) in the Source submenu or in the application menu in 
Document->Source.

Hope that helps,
George
--

-- 
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Peter Desjardins wrote:
>> My question: are there any possibilities to indent source code
>> automatically?
> 
> What tool are you using to author your DocBook content?
> 
(Continue reading)

Peter Desjardins | 6 Aug 15:41 2008
Picon

Re: source code and docbook

On Wed, Aug 6, 2008 at 3:49 AM, George Cristian Bina
<george <at> oxygenxml.com> wrote:

> Just a couple of clarifications.
>
>> I am including XML source code in programlistings also.  I've got
>> Oxygen to format the code and then I paste it into a programlisting
>> using XMLMind.
>
> If you paste XML code in the Author mode (the visual editing mode in oXygen)
> inside a programlisting element then oXygen will automatically consider that
> as text and will escape the tags.
> In Text mode (when you edit the XML source directly) we provide an "Escape
> selection" action to perform escaping on the current selection. You can find
> it in the contextual menu (right click on Windows, CTRL+click on Mac) in the
> Source submenu or in the application menu in Document->Source.

I'm glad you clarified that.  We are using XMLMind to author DocBook
content although I realize that oXygen also provides that function.
So using XMLMind to create the programlisting is easiest because of
our authoring process.

Peter
Andreas Peter | 6 Aug 21:40 2008
Picon

chapter space after

Hello DocBook users,

I´ve searched the web for a solution about space before and after for 
chapter titles. I want to generate a space after of each chapter title, 
but unfortunately I can´t find any solution to this :-( Are there any 
attribute-sets for this?

Thanks in advance,
Andreas

Gmane