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] Removing newlines between <para>s


Hello Bob!

Thank you for your answer.

The funny thing about
<para>Some text</para>
<para>Some text</para>
is that these paras are represented as two consecutive paragraphs when they are inside, for example, a <section>.
But when they are inside a table's (informaltable's in my case) entry, then an empty line is inserted between them for some reason.

<para>Some text</para><para>Some text</para> - this variant is displayed as two consecutive paragraphs always, without any empty line between them either inside an informaltable or outside.

Basically, the main goal was to get rid of this empty line in tables. It's a pity I can't insert screenshots in this message, it would be easier to explain :)

We are fighting this empty line now with some more complicated Perl scripting, because preserving nice indenting is also an important task for us.

--
Ekaterina Shikareva.

-----Original Message-----
From: Bob Stayton [mailto:bobs@sagehill.net]
Sent: Montag, 22. August 2016 19:44
To: Shikareva, Ekaterina; docbook-apps@lists.oasis-open.org
Subject: Re: [docbook-apps] Removing newlines between <para>s

Hi Ekaterina,
I'm not completely clear on what you need here.  In terms of DocBook XML, these two representations are semantically identical:

<para>Some text</para>
<para>Some text</para>

and

<para>Some text</para><para>Some text</para>

That is, white space between block elements like para is not considered significant, and will be ignored in any further processing to generate output.  So these two representations will produce identical output.

If your cleanup XSLT includes <xsl:output indent="yes"/>, then that is a global setting and is the reason why the two paras are on separate lines.  If you set indent="no", then those line breaks won't be added, but then line breaks won't be added anywhere.  Turning off the line breaks only within <entry> might be accomplished if you use <xsl:preserve-space> and <xsl:strip-space> in some combination, but I haven't tried it.

If instead you are asking that the content of the para elements be merged into a single para in the output, then that's a different thing.

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net

On 8/19/2016 7:48 AM, Shikareva, Ekaterina wrote:
> Hello,
>
>
>
> I have a task to combine a single DocBook XML file from several other
> source DocBook XML files. This is done with some Perl script. Next,
> I'm trying to prettify the result (also from inside my Perl script)
> using the following xslt stylesheet:
>
>
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>
> <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
>
> <xsl:strip-space elements="*"/>
>
> <xsl:template match="/">
>
>   <xsl:copy-of select="."/>
>
> </xsl:template>
>
> </xsl:stylesheet>
>
>
>
> In this resulting XML, I get the following formatting:
>
>
>
>     <section>
>
>       <title>Title</title>
>
>       <informaltable>
>
>         <tgroup cols="2">
>
>           <colspec colname="col2" colnum="2" colwidth="4*"/>
>
>           <tbody>
>
>             <row>
>
>               <entry>Some text</entry>
>
>               <entry>
>
>                 <para>Some text</para>
>
>                 <para>Some text</para>
>
>               </entry>
>
>             </row>
>
>           </tbody>
>
>         </tgroup>
>
>       </informaltable>
>
>     </section>
>
>
>
> But I need the <para>s inside the <entry> to stick together:
>
>
>
>     <section>
>
>       <title>Title</title>
>
>       <informaltable>
>
>         <tgroup cols="2">
>
>           <colspec colname="col2" colnum="2" colwidth="4*"/>
>
>           <tbody>
>
>             <row>
>
>               <entry>Some text</entry>
>
>               <entry>
>
>                 <para>Some text</para><para>Some text</para>
>
>               </entry>
>
>             </row>
>
>           </tbody>
>
>         </tgroup>
>
>       </informaltable>
>
>     </section>
>
>
>
> Even if these <para>s are on the same line in my source file, in the
> combined file they jump to different lines because of the formatting
> and indenting.
>
>
>
> What changes shall I introduce in my xslt stylesheet to solve this?
>
>
>
> Thank you!
>
>
>
> --
>
> Best regards,
>
>
>
> Ekaterina Shikareva
>
> Senior Technical Writer
>
>
>
>
> ----------------------------------------------------------------------
> --
>
> This e-mail and any attachment(s) are intended only for the
> recipient(s) named above and others who have been specifically
> authorized to receive them. They may contain confidential information.
> If you are not the intended recipient, please do not read this email or its attachment(s).
> Furthermore, you are hereby notified that any dissemination,
> distribution or copying of this e-mail and any attachment(s) is
> strictly prohibited. If you have received this e-mail in error, please
> immediately notify the sender by replying to this e-mail and then
> delete this e-mail and any attachment(s) or copies thereof from your system.
> Thank you.

________________________________

This e-mail and any attachment(s) are intended only for the recipient(s) named above and others who have been specifically authorized to receive them. They may contain confidential information. If you are not the intended recipient, please do not read this email or its attachment(s). Furthermore, you are hereby notified that any dissemination, distribution or copying of this e-mail and any attachment(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by replying to this e-mail and then delete this e-mail and any attachment(s) or copies thereof from your system. Thank you.


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