Author: manuel Date: 2007-04-03 13:24:15 -0600 (Tue, 03 Apr 2007) New Revision: 8010
Modified: branches/new-xsl/pdf/lfs-index.xsl Log: Revised pdf/lfs-index.xsl Modified: branches/new-xsl/pdf/lfs-index.xsl =================================================================== --- branches/new-xsl/pdf/lfs-index.xsl 2007-04-03 18:08:05 UTC (rev 8009) +++ branches/new-xsl/pdf/lfs-index.xsl 2007-04-03 19:24:15 UTC (rev 8010) @@ -1,16 +1,50 @@ <?xml version='1.0' encoding='ISO-8859-1'?> <!DOCTYPE xsl:stylesheet [ -<!ENTITY lowercase "'abcdefghijklmnopqrstuvwxyz'"> -<!ENTITY uppercase "'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"> -<!ENTITY primary 'normalize-space(concat(primary/@sortas, primary[not(@sortas)]))'> -<!ENTITY scope 'count(ancestor::node()|$scope) = count(ancestor::node())'> -]> +<!ENTITY lowercase "'AaÀàÁáÂâÃãÄäÅåĀāĂ㥹ǍǎǞǟǠǡǺǻȀȁȂȃȦȧḀḁẚẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặBbƀƁɓƂƃḂḃḄḅḆḇCcÇçĆćĈĉĊċČčƇƈɕḈḉDdĎďĐđƊɗƋƌDžDzȡɖḊḋḌḍḎḏḐḑḒḓEeÈèÉéÊêËëĒēĔĕĖėĘęĚěȄȅȆȇȨȩḔḕḖḗḘḙḚḛḜḝẸẹẺẻẼẽẾế& #7872;ềỂểỄễỆệFfƑƒḞḟGgĜĝĞğĠġĢģƓɠǤǥǦǧǴǵḠḡHhĤĥĦħȞȟɦḢḣḤḥḦḧḨḩḪḫẖIiÌìÍíÎîÏïĨĩĪīĬĭĮįİƗɨǏǐȈȉȊȋḬḭḮḯỈỉỊịJjĴĵǰʝKkĶķƘƙǨǩḰḱḲḳḴḵLlĹĺĻļĽľĿŀŁłƚLjȴɫɬɭḶḷḸḹḺḻḼḽMmɱḾḿṀṁṂṃNnÑñŃńŅņŇňƝɲƞȠNjǸǹȵɳṄṅṆṇṈṉṊ&# 7755;OoÒòÓóÔôÕõÖöØøŌōŎŏŐőƟƠơǑǒǪǫǬǭǾǿȌȍȎȏȪȫȬȭȮȯȰȱṌṍṎṏṐṑṒṓỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợPpƤƥṔṕṖṗQqʠRrŔŕŖŗŘřȐȑȒȓɼɽɾṘṙṚṛṜṝṞṟSsŚśŜŝŞşŠšȘșʂṠṡṢṣṤṥṦṧṨṩTtŢţŤťŦŧƫƬƭƮʈȚțȶṪṫṬṭṮṯṰṱẗUuÙùÚúÛû& #220;üŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜȔȕȖȗṲṳṴṵṶṷṸṹṺṻỤụỦủỨứỪừỬửỮữỰựVvƲʋṼṽṾṿWwŴŵẀẁẂẃẄẅẆẇẈẉẘXxẊẋẌẍYyÝýÿŸŶŷƳƴȲȳẎẏẙỲỳỴỵỶỷỸỹZzŹźŻżŽžƵƶȤȥʐʑẐẑẒẓẔẕẕ'"> +<!ENTITY uppercase "'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFFFFFGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIJJJJJJKKKKKKKKKKKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPPPPPQQQRRRRRRRRRRRRRRRRRRRRRRRSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTTTTTUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVVVVVVVWWWWWWWWWWWWWWWXXXXXXYYYYYYYYYYYYYYYYYYYYYYYZZZZZZZZZZZZZZZZZZZZZ'"> +<!ENTITY primary 'normalize-space(concat(primary/@sortas, primary[not(@sortas) or @sortas = ""]))'> +<!ENTITY scope "count(ancestor::node()|$scope) = count(ancestor::node()) and ($role = @role or $type = @type or (string-length($role) = 0 and string-length($type) = 0))"> +]> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> - <!--Title--> + <!-- REVISED --> + + <!-- This stylesheet controls how the Index is generated. + Entities comes from {docbook-xsl}/common/entities.ent --> + + <!-- Should the Index be generated? 1 = yes, 0 = no --> + <xsl:param name="generate.index" select="1"></xsl:param> + + <!-- The indexing method used. Only 'basic' is supported by xsltproc --> + <xsl:param name="index.method" select="'basic'"></xsl:param> + + <!-- Override for punctuation separating an index term from its list + of page references. --> + <xsl:param name="index.term.separator" select="': '"></xsl:param> + + <!-- Divisions title properties. --> + <xsl:attribute-set name="index.div.title.properties"> + <xsl:attribute name="margin-left">0pt</xsl:attribute> + <xsl:attribute name="font-size">14.4pt</xsl:attribute> + <xsl:attribute name="font-family"><xsl:value-of select="$title.fontset"></xsl:value-of></xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute> + <xsl:attribute name="space-before.optimum"><xsl:value-of select="concat($body.font.master,'pt')"/></xsl:attribute> + <xsl:attribute name="space-before.minimum"><xsl:value-of select="concat($body.font.master,'pt * 0.8')"/></xsl:attribute> + <xsl:attribute name="space-before.optimum"><xsl:value-of select="concat($body.font.master,'pt * 1.2')"/></xsl:attribute> + <xsl:attribute name="space-after.optimum"><xsl:value-of select="concat($body.font.master,'pt')"/></xsl:attribute> + <xsl:attribute name="space-after.minimum"><xsl:value-of select="concat($body.font.master,'pt * 0.8')"/></xsl:attribute> + <xsl:attribute name="space-after.optimum"><xsl:value-of select="concat($body.font.master,'pt * 1.2')"/></xsl:attribute> + <xsl:attribute name="start-indent">0pt</xsl:attribute> + </xsl:attribute-set> + + <!-- The Index title. + This template is not actually needed but placed here + to allow to change the title, if wanted. --> + <!-- The original template is in {docbook-xsl}/common/titles.xsl --> <xsl:template match="index" mode="title.markup"> <xsl:param name="allow-anchors" select="0"/> <xsl:call-template name="gentext"> @@ -18,9 +52,13 @@ </xsl:call-template> </xsl:template> - <!-- Divisions--> - <xsl:template match="indexterm" mode="index-div"> + <!-- Divisions: + Translate alphabetical divisons titles to by-type titles. --> + <!-- The original template is in {docbook-xsl}/fo/autoidx.xsl --> + <xsl:template match="indexterm" mode="index-div-basic"> <xsl:param name="scope" select="."/> + <xsl:param name="role" select="''"/> + <xsl:param name="type" select="''"/> <xsl:variable name="key" select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/> <xsl:variable name="divtitle" select="translate($key, &lowercase;, &uppercase;)"/> @@ -63,85 +101,18 @@ </xsl:with-param> </xsl:call-template> </xsl:if> - <fo:block> + <fo:block xsl:use-attribute-sets="index.entry.properties"> <xsl:apply-templates select="key('letter', $key)[&scope;] [count(.|key('primary', &primary;)[&scope;][1])=1]" mode="index-primary"> <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/> <xsl:with-param name="scope" select="$scope"/> + <xsl:with-param name="role" select="$role"/> + <xsl:with-param name="type" select="$type"/> </xsl:apply-templates> </fo:block> </fo:block> </xsl:if> </xsl:template> - <!-- The separator --> - <xsl:template match="indexterm" mode="reference"> - <xsl:param name="scope" select="."/> - <xsl:text>: </xsl:text> - <xsl:call-template name="reference"> - <xsl:with-param name="zones" select="normalize-space(@zone)"/> - <xsl:with-param name="scope" select="$scope"/> - </xsl:call-template> - </xsl:template> - - <!--Bookmarks--> - <xsl:template name="reference"> - <xsl:param name="scope" select="."/> - <xsl:param name="zones"/> - <xsl:choose> - <xsl:when test="contains($zones, ' ')"> - <xsl:variable name="zone" select="substring-before($zones, ' ')"/> - <xsl:variable name="zone2" select="substring-after($zones, ' ')"/> - <xsl:variable name="target" select="key('id', $zone)[&scope;]"/> - <xsl:variable name="target2" select="key('id', $zone2)[&scope;]"/> - <xsl:variable name="id"> - <xsl:call-template name="object.id"> - <xsl:with-param name="object" select="$target[1]"/> - </xsl:call-template> - </xsl:variable> - <xsl:variable name="id2"> - <xsl:call-template name="object.id"> - <xsl:with-param name="object" select="$target2[1]"/> - </xsl:call-template> - </xsl:variable> - <fo:basic-link internal-destination="{$id}"> - <xsl:apply-templates select="$target" mode="page.citation"> - <xsl:with-param name="id" select="$id"/> - </xsl:apply-templates> - </fo:basic-link> - <xsl:text> , </xsl:text> - <fo:basic-link internal-destination="{$id2}"> - <xsl:apply-templates select="$target2" mode="page.citation"> - <xsl:with-param name="id" select="$id2"/> - </xsl:apply-templates> - </fo:basic-link> - </xsl:when> - <xsl:otherwise> - <xsl:variable name="zone" select="$zones"/> - <xsl:variable name="target" select="key('id', $zone)[&scope;]"/> - <xsl:variable name="id"> - <xsl:call-template name="object.id"> - <xsl:with-param name="object" select="$target[1]"/> - </xsl:call-template> - </xsl:variable> - <fo:basic-link internal-destination="{$id}"> - <xsl:apply-templates select="$target" mode="page.citation"> - <xsl:with-param name="id" select="$id"/> - </xsl:apply-templates> - </fo:basic-link> - </xsl:otherwise> - </xsl:choose> - </xsl:template> - - <!-- Page number in Index--> - <xsl:template match="*" mode="page.citation"> - <xsl:param name="id" select="'???'"/> - <fo:inline keep-together.within-line="always"> - <!--<xsl:text>[p</xsl:text>--> - <fo:page-number-citation ref-id="{$id}"/> - <!--<xsl:text>]</xsl:text>--> - </fo:inline> - </xsl:template> - </xsl:stylesheet> -- http://linuxfromscratch.org/mailman/listinfo/lfs-book FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
