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] Persian digits in DocBook XSL numbering!


Hi,
thanks for your answer, it works fine! I could get the numbering format in 
Arabic-Indic. Is it possible to include the  Arabic-Indic numbering format 
in the next versions of DocDook XSLT stylesheets?

I have just another problem with numbering format, it is a right to left 
RTL problem with the section numbering. I use in my XML file the 
dir="rtl" attribute in <book dir="rtl">, it sets the main  direction to 
right side correctly.

For the chapter and section numbering I should have from the right side, 
first the chapter number and then the section number (the calculated 
section number with dots in between).

You can see my sample chunked HTML here:
http://user.cs.tu-berlin.de/~kiat/Persian-DocBook/index.html

My XML source file is here:
http://user.cs.tu-berlin.de/~kiat/fadocBook.xml

The format in English is:

Chapter 3. Using a mouse
3.1.  Basic mouse actions    sect1
3.1.1  Left button           sect2
3.1.2  Right button          sect2
3.1.2.1 Context menus        sect3
3.2.  Selecting              sect1
3.2.1  Click and drag
3.2.2  Double click

In a RTL language we should get from the right side:

             chapter-in-Persian .3
sect1    Basic mouse actions .1.3
sect2          Left button .1.1.3
sect2         Right button .2.1.3
sect3      Context menus .1.2.1.3
sect1              Selecting .2.3
             Click and drag .1.2.3
               Double click .2.2.3

I could find in common/fa.xml this:
./common/fa.xml:      <l:template name="sect1" text="%n.&#160;%t"/>
./common/fa.xml:      <l:template name="sect2" text="%n.&#160;%t"/>

I think here is everything in correct format. The %n included the whole 
number-chars with dots.

Could you please write me where I can find the codes for calculating the %n for the section numbering?

The direction should be also changed to the right side in header/footer, 
<revhistory>, <caution>, <note>, <important>
allover where the stylesheet create a table with <td colspan="3" 
align="left">, I should change all of them to the <td colspan="3" 
align="right">.
Can I use the dir attribute for these changes?

Kia Teymourian

On Wed, 5 Apr 2006, Bob Stayton wrote:
> Hi,
> In XSLT in general, you would add format="&#x661;", which is the number 1 in 
> Arabic-Indic numbers.  That tells the XSLT processor to use that sequence of 
> numbers instead of the sequence starting with "1".
>
> In the DocBook XSL stylesheets, though, you often don't need to use 
> xsl:number directly because there are parameters and utility templates for 
> setting number formats.  You must use version 1.69.1 or later of the 
> stylesheets.
>
> For example, to set the chapter number format, set this parameter:
>
> <xsl:param name="chapter.autolabel">&#x661;</xsl:param>
>
> Unfortunately, this doesn't quite work because the template that sets the 
> xsl:number checks to see if the specified format matches one of the 
> predefined formats (1, A, a, I, i).  This customization adds Arabic-Indic to 
> that list of accepted formats (this template is from common/labels.xsl):
>
> <xsl:template name="autolabel.format">
> <xsl:param name="context" select="."/>
> <xsl:param name="format"/>
>
> <xsl:choose>
>   <xsl:when test="string($format) != 0">
>     <xsl:choose>
>       <xsl:when test="$format='arabic' or $format='1'">1</xsl:when>
>       <xsl:when test="$format='loweralpha' or $format='a'">
>         <xsl:value-of select="'a'"/>
>       </xsl:when>
>       <xsl:when test="$format='lowerroman' or $format='i'">
>         <xsl:value-of select="'i'"/>
>       </xsl:when>
>       <xsl:when test="$format='upperalpha' or $format='A'">
>         <xsl:value-of select="'A'"/>
>       </xsl:when>
>       <xsl:when test="$format='upperroman' or $format='I'">
>         <xsl:value-of select="'I'"/>
>       </xsl:when>
>       <xsl:when test="$format='arabicindic' or $format='&#x661;'">
>         <xsl:value-of select="'&#x661;'"/>
>       </xsl:when>
>       <xsl:otherwise>
>         <xsl:message>
>           <xsl:text>Unexpected </xsl:text><xsl:value-of 
> select="local-name(.)"/><xsl:text>.autolabel value: </xsl:text>
>           <xsl:value-of select="$format"/><xsl:text>; using 
> default.</xsl:text>
>         </xsl:message>
>         <xsl:call-template name="default.autolabel.format"/>
>       </xsl:otherwise>
>     </xsl:choose>
>   </xsl:when>
> </xsl:choose>
> </xsl:template>
>
> This change should go into the main stylesheets, though.
>
> If you also want to set the page numbering to Arabic-Indic, then use these 
> two templates:
>
> <xsl:template name="page.number.format">&#x661;</xsl:template>
> <xsl:template name="initial.page.number">auto</xsl:template>
>
> The first one sets the page number format for all page-sequences, and the 
> second sets a single numbering sequence throughout the document.  In English, 
> the front matter starts with i, and then switches to 1 and restarts 
> numbering.  If you still want that, then customize the original versions of 
> these templates (located in fo/pagesetup.xsl).
>
> If you want to use Arabic-Indic numbering in procedures and steps, then you 
> will need to customize those templates and use xsl:number with the format 
> attribute.
>
> Bob Stayton
> Sagehill Enterprises
> DocBook Consulting
> bobs@sagehill.net
>
>
> ----- Original Message ----- From: "Kia Teymourian" <kiat@cs.tu-berlin.de>
> To: <docbook-apps@lists.oasis-open.org>
> Sent: Wednesday, April 05, 2006 2:54 AM
> Subject: [docbook-apps] Persian digits in DocBook XSL numbering!
>
>
>> Is it possible to change the DocBook XSL numbering language / character 
>> format, to have chapters or section numbers in Persian language.
>> 
>> I should get Unicode Persian digits in my Persian documentation, in native 
>> digits.
>> 
>> http://www.unicode.org/charts/PDF/U0600.pdf
>> 
>> Char   Dec. Hex Name
>> 0 1632 0660 ARABIC-INDIC DIGIT ZERO
>> 1 1633 0661 ARABIC-INDIC DIGIT ONE
>> 2 1634 0662 ARABIC-INDIC DIGIT TWO
>> 3 1635 0663 ARABIC-INDIC DIGIT THREE
>> 4 1636 0664 ARABIC-INDIC DIGIT FOUR
>> 5 1637 0665 ARABIC-INDIC DIGIT FIVE
>> 6 1638 0666 ARABIC-INDIC DIGIT SIX
>> 7 1639 0667 ARABIC-INDIC DIGIT SEVEN
>> 8 1640 0668 ARABIC-INDIC DIGIT EIGHT
>> 9 1641 0669 ARABIC-INDIC DIGIT NINE
>> 
>> Should I use the xsl:number lang or format in my customizing layer?
>> My processing system is Saxon 6.5.3, Linux, DocBook XSL 1.69.1.
>> 
>> Thanks
>> 
>> Kia Teymourian
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
>> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
>> 
>> 
>> 
>
>
>

Kia Teymourian


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