| … | |
… | |
| 19 | <!-- Include external stylesheets --> |
19 | <!-- Include external stylesheets --> |
| 20 | <xsl:include href="/xsl/content.xsl" /> |
20 | <xsl:include href="/xsl/content.xsl" /> |
| 21 | <xsl:include href="/xsl/handbook.xsl" /> |
21 | <xsl:include href="/xsl/handbook.xsl" /> |
| 22 | <xsl:include href="/xsl/inserts.xsl" /> |
22 | <xsl:include href="/xsl/inserts.xsl" /> |
| 23 | |
23 | |
|
|
24 | <xsl:include href="/xsl/mail.xsl" /> |
|
|
25 | |
| 24 | <xsl:include href="/xsl/devmap.xsl" /> |
26 | <xsl:include href="/xsl/devmap.xsl" /> |
|
|
27 | |
|
|
28 | <xsl:include href="/xsl/doc-struct.xsl" /> |
| 25 | |
29 | |
| 26 | <!-- When using <pre>, whitespaces should be preserved --> |
30 | <!-- When using <pre>, whitespaces should be preserved --> |
| 27 | <xsl:preserve-space elements="pre script"/> |
31 | <xsl:preserve-space elements="pre script"/> |
| 28 | |
32 | |
| 29 | <!-- Global definition of style parameter --> |
33 | <!-- Global definition of style parameter --> |
| … | |
… | |
| 36 | <!-- Nick to select on dev map --> |
40 | <!-- Nick to select on dev map --> |
| 37 | <xsl:param name="dev"/> |
41 | <xsl:param name="dev"/> |
| 38 | |
42 | |
| 39 | <!-- Where is this xsl being run? --> |
43 | <!-- Where is this xsl being run? --> |
| 40 | <xsl:param name="httphost">www</xsl:param> |
44 | <xsl:param name="httphost">www</xsl:param> |
| 41 | |
|
|
| 42 | <!-- Get the list of retired devs from the roll-call --> |
|
|
| 43 | <xsl:variable name="RETIRED-DEVS" xmlns=""> |
|
|
| 44 | <retired> |
|
|
| 45 | <xsl:for-each select="document('/proj/en/devrel/roll-call/userinfo.xml')/userlist/user[translate(status,'TIRED','tired')='retired']"> |
|
|
| 46 | <user username="{@username}"> |
|
|
| 47 | <xsl:copy-of select="realname"/> |
|
|
| 48 | <xsl:copy-of select="email[substring-after(text(),'@')!='gentoo.org']"/> |
|
|
| 49 | </user> |
|
|
| 50 | </xsl:for-each> |
|
|
| 51 | </retired> |
|
|
| 52 | </xsl:variable> |
|
|
| 53 | |
45 | |
| 54 | <!-- img tag --> |
46 | <!-- img tag --> |
| 55 | <xsl:template match="img"> |
47 | <xsl:template match="img"> |
| 56 | <img src="{@src}" alt=""/> |
48 | <img src="{@src}" alt=""/> |
| 57 | </xsl:template> |
49 | </xsl:template> |
| … | |
… | |
| 110 | <xsl:if test="string-length($outdated) > 1"> |
102 | <xsl:if test="string-length($outdated) > 1"> |
| 111 | <br/><b><i><xsl:copy-of select="$outdated"/></i></b> |
103 | <br/><b><i><xsl:copy-of select="$outdated"/></i></b> |
| 112 | </xsl:if> |
104 | </xsl:if> |
| 113 | </xsl:when> |
105 | </xsl:when> |
| 114 | <xsl:otherwise> |
106 | <xsl:otherwise> |
| 115 | <xsl:if test="count(/guide/chapter)>1"> |
107 | <xsl:if test="count(exslt:node-set($doc-struct)//chapter)>1"> |
| 116 | <form name="contents" action="http://www.gentoo.org"> |
108 | <form name="contents" action="http://www.gentoo.org"> |
| 117 | <b><xsl:value-of select="func:gettext('Content')"/></b>: |
109 | <b><xsl:value-of select="func:gettext('Content')"/></b>: |
| 118 | <select name="url" size="1" OnChange="location.href=form.url.options[form.url.selectedIndex].value" style="font-family:sans-serif,Arial,Helvetica"> |
110 | <select name="url" size="1" OnChange="location.href=form.url.options[form.url.selectedIndex].value" style="font-family:sans-serif,Arial,Helvetica"> |
| 119 | <xsl:for-each select="chapter"> |
111 | <xsl:for-each select="exslt:node-set($doc-struct)//chapter"> |
| 120 | <xsl:variable name="chapid">doc_chap<xsl:number/></xsl:variable><option value="#{$chapid}"><xsl:number/>. <xsl:value-of select="title"/></option> |
112 | <option value="#doc_chap{position()}"><xsl:number/>. <xsl:value-of select="@title"/></option> |
| 121 | </xsl:for-each> |
113 | </xsl:for-each> |
| 122 | </select> |
114 | </select> |
| 123 | </form> |
115 | </form> |
| 124 | </xsl:if> |
116 | </xsl:if> |
| 125 | </xsl:otherwise> |
117 | </xsl:otherwise> |
| … | |
… | |
| 156 | <!-- Support for opensearch --> |
148 | <!-- Support for opensearch --> |
| 157 | <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/www-gentoo-org.xml" title="Gentoo Website"/> |
149 | <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/www-gentoo-org.xml" title="Gentoo Website"/> |
| 158 | <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/forums-gentoo-org.xml" title="Gentoo Forums"/> |
150 | <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/forums-gentoo-org.xml" title="Gentoo Forums"/> |
| 159 | <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/bugs-gentoo-org.xml" title="Gentoo Bugzilla"/> |
151 | <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/bugs-gentoo-org.xml" title="Gentoo Bugzilla"/> |
| 160 | <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/packages-gentoo-org.xml" title="Gentoo Packages"/> |
152 | <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/packages-gentoo-org.xml" title="Gentoo Packages"/> |
|
|
153 | <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/archives-gentoo-org.xml" title="Gentoo List Archives"/> |
| 161 | |
154 | |
| 162 | <xsl:if test="//glsaindex or //glsa-latest"> |
155 | <xsl:if test="//glsaindex or //glsa-latest"> |
| 163 | <link rel="alternate" type="application/rss+xml"> |
156 | <link rel="alternate" type="application/rss+xml"> |
| 164 | <xsl:attribute name="href"> |
157 | <xsl:attribute name="href"> |
| 165 | <xsl:text>/rdf/en/glsa-index.rdf</xsl:text> |
158 | <xsl:text>/rdf/en/glsa-index.rdf</xsl:text> |
| … | |
… | |
| 260 | </xsl:choose> |
253 | </xsl:choose> |
| 261 | </html> |
254 | </html> |
| 262 | </xsl:template> |
255 | </xsl:template> |
| 263 | |
256 | |
| 264 | |
257 | |
| 265 | <xsl:template match="/gleps|/devaway|/uris|/inserts|/glsa-index|opensearch:OpenSearchDescription"> |
258 | <xsl:template match="/included|/gleps|/devaway|/uris|/inserts|/glsa-index|opensearch:OpenSearchDescription"> |
| 266 | <xsl:message> |
259 | <xsl:message> |
| 267 | <xsl:value-of select="concat('%%GORG%%Redirect=',$link,'?passthru=1')"/> |
260 | <xsl:value-of select="concat('%%GORG%%Redirect=',$link,'?passthru=1')"/> |
| 268 | </xsl:message> |
261 | </xsl:message> |
| 269 | </xsl:template> |
262 | </xsl:template> |
| 270 | |
263 | |
| … | |
… | |
| 287 | <!-- Support for opensearch --> |
280 | <!-- Support for opensearch --> |
| 288 | <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/www-gentoo-org.xml" title="Gentoo Website"/> |
281 | <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/www-gentoo-org.xml" title="Gentoo Website"/> |
| 289 | <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/forums-gentoo-org.xml" title="Gentoo Forums"/> |
282 | <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/forums-gentoo-org.xml" title="Gentoo Forums"/> |
| 290 | <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/bugs-gentoo-org.xml" title="Gentoo Bugzilla"/> |
283 | <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/bugs-gentoo-org.xml" title="Gentoo Bugzilla"/> |
| 291 | <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/packages-gentoo-org.xml" title="Gentoo Packages"/> |
284 | <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/packages-gentoo-org.xml" title="Gentoo Packages"/> |
|
|
285 | <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/archives-gentoo-org.xml" title="Gentoo List Archives"/> |
| 292 | |
286 | |
|
|
287 | <xsl:if test="/*[1][@redirect]"> |
|
|
288 | <!-- Immediate HTML refresh in case redirect is not supported --> |
|
|
289 | <meta http-equiv="Refresh"> |
|
|
290 | <xsl:attribute name="content"><xsl:value-of select="concat('0; URL=', /*[1]/@redirect)"/></xsl:attribute> |
|
|
291 | </meta> |
|
|
292 | <xsl:message> |
|
|
293 | <!-- Redirect using http header when supported --> |
|
|
294 | <xsl:value-of select="concat('%%GORG%%Redirect=',/*[1]/@redirect)"/> |
|
|
295 | </xsl:message> |
|
|
296 | </xsl:if> |
|
|
297 | |
| 293 | <xsl:if test="/mainpage/newsitems"> |
298 | <xsl:if test="/mainpage/newsitems"> |
| 294 | <link rel="alternate" type="application/rss+xml" title="Gentoo Linux News RDF" href="http://www.gentoo.org/rdf/en/gentoo-news.rdf" /> |
299 | <link rel="alternate" type="application/rss+xml" title="Gentoo Linux News RDF" href="http://www.gentoo.org/rdf/en/gentoo-news.rdf" /> |
| 295 | </xsl:if> |
300 | </xsl:if> |
| 296 | <xsl:choose> |
301 | <xsl:choose> |
| 297 | <xsl:when test="/mainpage | /news"> |
302 | <xsl:when test="/mainpage | /news"> |
| … | |
… | |
| 380 | </xsl:choose> |
385 | </xsl:choose> |
| 381 | Lists</a> |
386 | Lists</a> |
| 382 | | <a class="menulink" href="http://bugs.gentoo.org">Bugs</a> |
387 | | <a class="menulink" href="http://bugs.gentoo.org">Bugs</a> |
| 383 | | <a class="menulink" href="http://www.cafepress.com/officialgentoo/">Store</a> |
388 | | <a class="menulink" href="http://www.cafepress.com/officialgentoo/">Store</a> |
| 384 | | |
389 | | |
| 385 | <a class="menulink" href="{concat($www,'/news/en/gwn/gwn.xml')}"> |
390 | <a class="menulink" href="{concat($www,'/news/en/gmn/')}"> |
| 386 | <xsl:choose> |
391 | <xsl:choose> |
| 387 | <xsl:when test="starts-with($tpath, '/news/**/gwn/')"> |
392 | <xsl:when test="starts-with($tpath, '/news/**/gmn/')"> |
| 388 | <xsl:attribute name="class">highlight</xsl:attribute> |
393 | <xsl:attribute name="class">highlight</xsl:attribute> |
| 389 | <xsl:attribute name="href"><xsl:value-of select="$link"/></xsl:attribute> |
394 | <xsl:attribute name="href"><xsl:value-of select="$link"/></xsl:attribute> |
| 390 | </xsl:when> |
395 | </xsl:when> |
| 391 | <xsl:when test="not($isEnglish='Y' or document(concat('/news/', $glang, '/gwn/gwn.xml'))/missing)"> |
396 | <xsl:when test="not($isEnglish='Y' or document(concat('/news/', $glang, '/gmn/index.xml'))/missing)"> |
| 392 | <xsl:attribute name="href"><xsl:value-of select="concat('/news/',$glang,'/gwn/gwn.xml')"/></xsl:attribute> |
397 | <xsl:attribute name="href"><xsl:value-of select="concat('/news/',$glang,'/gmn/index.xml')"/></xsl:attribute> |
| 393 | </xsl:when> |
398 | </xsl:when> |
| 394 | </xsl:choose> |
399 | </xsl:choose> |
| 395 | GWN</a> |
400 | GMN</a> |
| 396 | | |
401 | | |
| 397 | <a class="menulink" href="{concat($www,'/main/en/where.xml')}"> |
402 | <a class="menulink" href="{concat($www,'/main/en/where.xml')}"> |
| 398 | <xsl:choose> |
403 | <xsl:choose> |
| 399 | <xsl:when test="$tpath='/main/**/where.xml'"> |
404 | <xsl:when test="$tpath='/main/**/where.xml'"> |
| 400 | <xsl:attribute name="class">highlight</xsl:attribute> |
405 | <xsl:attribute name="class">highlight</xsl:attribute> |
| … | |
… | |
| 548 | <br/> |
553 | <br/> |
| 549 | <a class="altlink" href="{concat($www,'/proj/en/devrel/staffing-needs/')}">Staffing Needs</a> |
554 | <a class="altlink" href="{concat($www,'/proj/en/devrel/staffing-needs/')}">Staffing Needs</a> |
| 550 | <br/> |
555 | <br/> |
| 551 | <a class="altlink" href="http://vendors.gentoo.org/">Supporting Vendors</a> |
556 | <a class="altlink" href="http://vendors.gentoo.org/">Supporting Vendors</a> |
| 552 | <br/> |
557 | <br/> |
| 553 | <a class="altlink" href="http://sources.gentoo.org/">View our CVS</a> |
558 | <a class="altlink" href="http://sources.gentoo.org/">View our Sources</a> |
| 554 | <br/><br/> |
559 | <br/><br/> |
| 555 | Graphics: |
560 | Graphics: |
| 556 | <br/> |
561 | <br/> |
| 557 | <a class="altlink" href="{concat($www,'/main/en/graphics.xml')}"> |
562 | <a class="altlink" href="{concat($www,'/main/en/graphics.xml')}"> |
| 558 | <xsl:if test="not($isEnglish='Y' or document(concat('/main/', $glang, '/graphics.xml'))/missing)"> |
563 | <xsl:if test="not($isEnglish='Y' or document(concat('/main/', $glang, '/graphics.xml'))/missing)"> |
| … | |
… | |
| 668 | <xsl:value-of select="concat('/main/', $glang, '/contact.xml')"/> |
673 | <xsl:value-of select="concat('/main/', $glang, '/contact.xml')"/> |
| 669 | </xsl:when> |
674 | </xsl:when> |
| 670 | <xsl:otherwise>/main/en/contact.xml</xsl:otherwise> |
675 | <xsl:otherwise>/main/en/contact.xml</xsl:otherwise> |
| 671 | </xsl:choose> |
676 | </xsl:choose> |
| 672 | </xsl:variable> |
677 | </xsl:variable> |
| 673 | Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Foundation, Inc. Questions, Comments? <a class="highlight" href="{concat($www, $contact)}">Contact us</a>. |
678 | Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Foundation, Inc. Questions, Comments? <a class="highlight" href="{concat($www, $contact)}">Contact us</a>. |
| 674 | </xsl:template> |
679 | </xsl:template> |
| 675 | |
680 | |
| 676 | <!-- Mail template --> |
681 | <!-- Mail template --> |
| 677 | <xsl:template match="mail"> |
682 | <xsl:template match="mail"> |
| 678 | <a> |
683 | <xsl:variable name="mail"> |
| 679 | <xsl:attribute name="href"> |
684 | <xsl:call-template name="smart-mail"> |
| 680 | <xsl:choose> |
685 | <xsl:with-param name="mail" select="."/> |
| 681 | <xsl:when test="@link"> |
|
|
| 682 | <xsl:value-of select="concat('mailto:', @link)"/> |
|
|
| 683 | </xsl:when> |
|
|
| 684 | <xsl:otherwise> |
|
|
| 685 | <xsl:value-of select="concat('mailto:', .)"/> |
|
|
| 686 | </xsl:otherwise> |
|
|
| 687 | </xsl:choose> |
|
|
| 688 | </xsl:attribute> |
|
|
| 689 | <xsl:value-of select="."/> |
|
|
| 690 | </a> |
|
|
| 691 | |
|
|
| 692 | </xsl:template> |
686 | </xsl:call-template> |
|
|
687 | </xsl:variable> |
| 693 | |
688 | |
| 694 | <!-- Mail inside <author>...</author> --> |
|
|
| 695 | <xsl:template match="/*[1]/author/mail"> |
|
|
| 696 | <xsl:variable name="nick" select="substring-before(@link,'@gentoo.org')"/> |
|
|
| 697 | <xsl:choose> |
689 | <xsl:choose> |
| 698 | <xsl:when test="substring-after(@link,'@')='gentoo.org' and exslt:node-set($RETIRED-DEVS)/retired/user[@username=$nick]"> |
690 | <xsl:when test="string-length(exslt:node-set($mail)/mail/@link)>0"> |
| 699 | <!-- @gentoo.org address of a retired dev, use another email from roll-call, or no email at all --> |
691 | <a href="{concat('mailto:',exslt:node-set($mail)/mail/@link)}"> |
| 700 | <xsl:choose> |
692 | <xsl:choose> |
| 701 | <xsl:when test="exslt:node-set($RETIRED-DEVS)/retired/user[@username=$nick]/email"> |
693 | <xsl:when test="name(..)='author'"> |
| 702 | <b><a class="altlink" href="mailto:{exslt:node-set($RETIRED-DEVS)/retired/user[@username=$nick]/email[1]}"><xsl:value-of select="."/></a></b> |
694 | <xsl:attribute name="class">altlink</xsl:attribute> |
|
|
695 | <b><xsl:value-of select="exslt:node-set($mail)/mail/text()"/></b> |
| 703 | </xsl:when> |
696 | </xsl:when> |
| 704 | <xsl:otherwise> |
697 | <xsl:otherwise> |
| 705 | <xsl:value-of select="."/> |
698 | <xsl:value-of select="exslt:node-set($mail)/mail/text()"/> |
| 706 | </xsl:otherwise> |
699 | </xsl:otherwise> |
| 707 | </xsl:choose> |
700 | </xsl:choose> |
|
|
701 | </a> |
| 708 | </xsl:when> |
702 | </xsl:when> |
| 709 | <xsl:otherwise> |
703 | <xsl:otherwise><xsl:value-of select="exslt:node-set($mail)/mail/text()"/></xsl:otherwise> |
| 710 | <b><a class="altlink" href="mailto:{@link}"><xsl:value-of select="."/></a></b> |
|
|
| 711 | </xsl:otherwise> |
|
|
| 712 | </xsl:choose> |
704 | </xsl:choose> |
| 713 | |
|
|
| 714 | </xsl:template> |
705 | </xsl:template> |
| 715 | |
706 | |
| 716 | <!-- Author --> |
707 | <!-- Author --> |
| 717 | <xsl:template match="author"> |
708 | <xsl:template match="author"> |
| 718 | <xsl:apply-templates/> |
709 | <xsl:apply-templates/> |
| 719 | <xsl:if test="@title"> |
710 | <xsl:if test="@title"> |
| 720 | <xsl:if test="$style != 'printable'"> |
711 | <xsl:if test="$style != 'printable'"><br/></xsl:if> |
| 721 | <br/> |
|
|
| 722 | </xsl:if> |
|
|
| 723 | <xsl:if test="$style = 'printable'"> </xsl:if> |
712 | <xsl:if test="$style = 'printable'"> </xsl:if> |
| 724 | <i><xsl:value-of select="@title"/></i> |
713 | <i><xsl:value-of select="@title"/></i> |
| 725 | </xsl:if> |
714 | </xsl:if> |
| 726 | <br/> |
715 | <br/> |
| 727 | <xsl:if test="$style != 'printable' and position()!=last()"> |
716 | <xsl:if test="$style != 'printable' and position() != last()"><br/></xsl:if> |
| 728 | <br/> |
|
|
| 729 | </xsl:if> |
|
|
| 730 | </xsl:template> |
717 | </xsl:template> |
| 731 | |
718 | |
| 732 | <!-- FAQ Index & Chapter --> |
719 | <!-- FAQ Index & Chapter --> |
| 733 | <xsl:template match="faqindex|chapter"> |
720 | <xsl:template match="faqindex|chapter|/sections/section"> |
| 734 | <xsl:variable name="chid"><xsl:number count="faqindex|chapter"/></xsl:variable> |
721 | <xsl:if test="not(@test) or dyn:evaluate(@test)"> |
|
|
722 | <xsl:variable name="uid" select="generate-id(.)" /> |
|
|
723 | <xsl:variable name="chid"> |
|
|
724 | <xsl:value-of select="1+count(exslt:node-set($doc-struct)//chapter[@uid=$uid]/preceding-sibling::chapter)"/> |
|
|
725 | </xsl:variable> |
|
|
726 | |
|
|
727 | <xsl:variable name="partnum"> |
|
|
728 | <xsl:value-of select="exslt:node-set($doc-struct)//bookpart[descendant::*[@uid=$uid]]/@pos"/> |
|
|
729 | </xsl:variable> |
|
|
730 | <xsl:variable name="chapnum"> |
|
|
731 | <xsl:value-of select="exslt:node-set($doc-struct)//bookchap[descendant::*[@uid=$uid]]/@pos"/> |
|
|
732 | </xsl:variable> |
|
|
733 | |
| 735 | <xsl:choose> |
734 | <xsl:choose> |
|
|
735 | <xsl:when test="include"> |
|
|
736 | <xsl:apply-templates select="document(include/@href)//chapter"/> |
|
|
737 | </xsl:when> |
|
|
738 | |
| 736 | <xsl:when test="title"> |
739 | <xsl:when test="title"> |
|
|
740 | <xsl:if test="not(position()=1 and title/text()=/mainpage/title)"> |
|
|
741 | |
| 737 | <p class="chaphead"> |
742 | <p class="chaphead"> |
| 738 | <xsl:if test="@id"><a name="{@id}"/></xsl:if> |
743 | <xsl:if test="@id"> |
| 739 | <a name="doc_chap{$chid}"/> |
744 | <a name="{@id}"/> |
| 740 | <xsl:if test="not(/mainpage) and (count(//faqindex)+count(//chapter))>1"> |
|
|
| 741 | <span class="chapnum"><xsl:value-of select="$chid"/>. </span> |
|
|
| 742 | </xsl:if> |
745 | </xsl:if> |
|
|
746 | |
|
|
747 | <xsl:choose> |
|
|
748 | <xsl:when test="$TTOP='book' and $full != 0"> |
|
|
749 | <a name="book_part{$partnum}_chap{$chapnum}__chap{$chid}"/> |
|
|
750 | </xsl:when> |
|
|
751 | <xsl:otherwise> |
|
|
752 | <a name="doc_chap{$chid}"/> |
|
|
753 | </xsl:otherwise> |
|
|
754 | </xsl:choose> |
|
|
755 | |
|
|
756 | <span class="chapnum"> |
|
|
757 | <xsl:choose> |
|
|
758 | <xsl:when test="$TTOP='book'"> |
|
|
759 | <xsl:value-of select="$chapnum" />.<xsl:number level="multiple" format="a. " value="$chid"/> |
|
|
760 | </xsl:when> |
|
|
761 | <xsl:otherwise> |
|
|
762 | <xsl:value-of select="$chid"/>.  |
|
|
763 | </xsl:otherwise> |
|
|
764 | </xsl:choose> |
|
|
765 | </span> |
| 743 | <xsl:value-of select="title"/> |
766 | <xsl:value-of select="title"/> |
| 744 | </p> |
767 | </p> |
|
|
768 | |
|
|
769 | </xsl:if> |
| 745 | </xsl:when> |
770 | </xsl:when> |
| 746 | <xsl:otherwise> |
771 | <xsl:otherwise> |
| 747 | <xsl:if test="/guide"> |
772 | <xsl:if test="/guide"> |
| 748 | <p class="chaphead"> |
773 | <p class="chaphead"> |
| 749 | <span class="chapnum"> |
774 | <span class="chapnum"> |
| … | |
… | |
| 751 | </span> |
776 | </span> |
| 752 | </p> |
777 | </p> |
| 753 | </xsl:if> |
778 | </xsl:if> |
| 754 | </xsl:otherwise> |
779 | </xsl:otherwise> |
| 755 | </xsl:choose> |
780 | </xsl:choose> |
| 756 | <xsl:apply-templates select="body"> |
781 | |
| 757 | <xsl:with-param name="chid" select="$chid"/> |
|
|
| 758 | </xsl:apply-templates> |
|
|
| 759 | <xsl:apply-templates select="section"> |
782 | <xsl:apply-templates select="section|subsection|body"/> |
| 760 | <xsl:with-param name="chid" select="$chid"/> |
|
|
| 761 | </xsl:apply-templates> |
|
|
| 762 | |
783 | |
| 763 | <xsl:if test="name()='faqindex'"> |
784 | <xsl:if test="name()='faqindex'"> |
| 764 | <!-- Generate FAQ index --> |
785 | <!-- Generate FAQ index --> |
| 765 | |
786 | |
| 766 | <xsl:for-each select="./following-sibling::chapter"> |
787 | <xsl:for-each select="exslt:node-set($doc-struct)//chapter[position()>1]"> |
| 767 | <xsl:if test="section/title"> |
788 | <xsl:if test="section[@title]"> |
| 768 | <p class="secthead"> |
789 | <p class="secthead"> |
| 769 | <xsl:value-of select="title"/> |
790 | <xsl:value-of select="@title"/> |
| 770 | </p> |
791 | </p> |
| 771 | <xsl:variable name="nchap"><xsl:value-of select="1+position()"/></xsl:variable> |
792 | <xsl:variable name="nchap"><xsl:value-of select="1+position()"/></xsl:variable> |
| 772 | <ul> |
793 | <ul> |
| 773 | <xsl:for-each select="section"> |
794 | <xsl:for-each select="section"> |
| 774 | <xsl:if test="title"> |
795 | <xsl:if test="@title"> |
| 775 | <li> |
796 | <li> |
| 776 | <a> |
797 | <a> |
| 777 | <xsl:attribute name="href"> |
798 | <xsl:attribute name="href"> |
| 778 | <xsl:choose> |
799 | <xsl:choose> |
| 779 | <xsl:when test="@id"> |
800 | <xsl:when test="@id"> |
| … | |
… | |
| 782 | <xsl:otherwise> |
803 | <xsl:otherwise> |
| 783 | <xsl:value-of select="concat('#doc_chap', $nchap, '_sect')"/><xsl:number/> |
804 | <xsl:value-of select="concat('#doc_chap', $nchap, '_sect')"/><xsl:number/> |
| 784 | </xsl:otherwise> |
805 | </xsl:otherwise> |
| 785 | </xsl:choose> |
806 | </xsl:choose> |
| 786 | </xsl:attribute> |
807 | </xsl:attribute> |
| 787 | <xsl:value-of select="title"/> |
808 | <xsl:value-of select="@title"/> |
| 788 | </a> |
809 | </a> |
| 789 | </li> |
810 | </li> |
| 790 | </xsl:if> |
811 | </xsl:if> |
| 791 | </xsl:for-each> |
812 | </xsl:for-each> |
| 792 | </ul> |
813 | </ul> |
| 793 | </xsl:if> |
814 | </xsl:if> |
| 794 | </xsl:for-each> |
815 | </xsl:for-each> |
| 795 | </xsl:if> |
816 | </xsl:if> |
|
|
817 | </xsl:if> |
| 796 | </xsl:template> |
818 | </xsl:template> |
| 797 | |
819 | |
| 798 | |
820 | |
| 799 | <!-- Section template --> |
821 | <!-- Section template --> |
| 800 | <xsl:template match="section"> |
822 | <xsl:template match="section|/sections/section/subsection"> |
|
|
823 | <xsl:if test="not(@test) or dyn:evaluate(@test)"> |
|
|
824 | |
|
|
825 | <xsl:variable name="uid" select="generate-id(.)" /> |
| 801 | <xsl:param name="chid"/> |
826 | <xsl:variable name="chid"> |
|
|
827 | <xsl:value-of select="1+count(exslt:node-set($doc-struct)//chapter[descendant::section[@uid=$uid]]/preceding-sibling::chapter)"/> |
|
|
828 | </xsl:variable> |
|
|
829 | <xsl:variable name="seid"> |
|
|
830 | <xsl:value-of select="1+count(exslt:node-set($doc-struct)//section[@uid=$uid]/preceding-sibling::section)"/> |
|
|
831 | </xsl:variable> |
|
|
832 | |
|
|
833 | <xsl:variable name="partnum"> |
|
|
834 | <xsl:value-of select="exslt:node-set($doc-struct)//bookpart[descendant::*[@uid=$uid]]/@pos"/> |
|
|
835 | </xsl:variable> |
|
|
836 | <xsl:variable name="chapnum"> |
|
|
837 | <xsl:value-of select="exslt:node-set($doc-struct)//bookchap[descendant::*[@uid=$uid]]/@pos"/> |
|
|
838 | </xsl:variable> |
|
|
839 | |
|
|
840 | <xsl:choose> |
|
|
841 | <xsl:when test="include"> |
|
|
842 | <xsl:apply-templates select="document(include/@href)//section"/> |
|
|
843 | </xsl:when> |
|
|
844 | |
| 802 | <xsl:if test="title"> |
845 | <xsl:when test="title"> |
| 803 | <xsl:variable name="sectid">doc_chap<xsl:value-of select="$chid"/>_sect<xsl:number/></xsl:variable> |
846 | <xsl:variable name="sectid"> |
| 804 | <xsl:if test="@id"> |
847 | <xsl:choose> |
| 805 | <a name="{@id}"/> |
848 | <xsl:when test="$TTOP='book' and $full != 0"> |
| 806 | </xsl:if> |
849 | <xsl:value-of select="concat('book_part', $partnum, '_chap', $chapnum, '__chap', $chid, '_sect', $seid)"/> |
|
|
850 | </xsl:when> |
|
|
851 | <xsl:otherwise> |
|
|
852 | <xsl:value-of select="concat('doc_chap', $chid, '_sect', $seid)"/> |
|
|
853 | </xsl:otherwise> |
|
|
854 | </xsl:choose> |
|
|
855 | </xsl:variable> |
|
|
856 | |
| 807 | <p class="secthead"> |
857 | <p class="secthead"> |
|
|
858 | <xsl:if test="@id"> |
|
|
859 | <a name="{@id}"/></xsl:if> |
| 808 | <a name="{$sectid}"><xsl:value-of select="title"/></a> |
860 | <a name="{$sectid}"><xsl:value-of select="title"/></a> |
| 809 | </p> |
861 | </p> |
| 810 | </xsl:if> |
862 | </xsl:when> |
|
|
863 | </xsl:choose> |
|
|
864 | |
| 811 | <xsl:apply-templates select="body"> |
865 | <xsl:apply-templates select="body"/> |
| 812 | <xsl:with-param name="chid" select="$chid"/> |
866 | </xsl:if> |
| 813 | </xsl:apply-templates> |
|
|
| 814 | </xsl:template> |
867 | </xsl:template> |
| 815 | |
868 | |
| 816 | <!-- Figure template --> |
869 | <!-- Figure template --> |
| 817 | <xsl:template match="figure"> |
870 | <xsl:template match="figure"> |
|
|
871 | <xsl:variable name="uid" select="generate-id(.)" /> |
| 818 | <xsl:param name="chid"/> |
872 | <xsl:variable name="chid"> |
| 819 | <xsl:variable name="fignum"><xsl:number level="any" from="chapter" count="figure"/></xsl:variable> |
873 | <xsl:value-of select="1+count(exslt:node-set($doc-struct)//chapter[descendant::figure[@uid=$uid]]/preceding-sibling::chapter)"/> |
| 820 | <xsl:variable name="figid">doc_chap<xsl:value-of select="$chid"/>_fig<xsl:value-of select="$fignum"/></xsl:variable> |
874 | </xsl:variable> |
| 821 | <xsl:variable name="llink"> |
875 | <xsl:variable name="fignum"> |
|
|
876 | <xsl:value-of select="1+count(exslt:node-set($doc-struct)//chapter[descendant::figure[@uid=$uid]]//figure[following::figure[@uid=$uid]])"/> |
|
|
877 | </xsl:variable> |
|
|
878 | <xsl:variable name="figid"> |
| 822 | <xsl:choose> |
879 | <xsl:choose> |
| 823 | <xsl:when test="starts-with(@link,'http://www.gentoo.org/')"> |
880 | <xsl:when test="($TTOP = 'book') and ($full != 0)"> |
| 824 | <xsl:value-of select="concat($ROOT, substring-after(@link, 'http://www.gentoo.org/'))"/> |
881 | <xsl:value-of select="concat('book_part', exslt:node-set($doc-struct)//bookpart[descendant::figure[@uid=$uid]]/@pos, '_chap', exslt:node-set($doc-struct)//bookchap[descendant::figure[@uid=$uid]]/@pos, '__chap', $chid, '_fig', $fignum)"/> |
| 825 | </xsl:when> |
|
|
| 826 | <xsl:when test="starts-with(@link,'/')"> |
|
|
| 827 | <xsl:value-of select="concat($ROOT, substring-after(@link, '/'))"/> |
|
|
| 828 | </xsl:when> |
882 | </xsl:when> |
| 829 | <xsl:otherwise> |
883 | <xsl:otherwise> |
| 830 | <xsl:value-of select="@link"/> |
884 | <xsl:value-of select="concat('doc_chap', $chid, '_fig', $fignum)"/> |
| 831 | </xsl:otherwise> |
885 | </xsl:otherwise> |
| 832 | </xsl:choose> |
886 | </xsl:choose> |
| 833 | </xsl:variable> |
887 | </xsl:variable> |
|
|
888 | |
|
|
889 | <xsl:variable name="llink"> |
|
|
890 | <xsl:choose> |
|
|
891 | <xsl:when test="starts-with(@link,'http://www.gentoo.org/')"> |
|
|
892 | <xsl:value-of select="concat($ROOT, substring-after(@link, 'http://www.gentoo.org/'))"/> |
|
|
893 | </xsl:when> |
|
|
894 | <xsl:when test="starts-with(@link,'/')"> |
|
|
895 | <xsl:value-of select="concat($ROOT, substring-after(@link, '/'))"/> |
|
|
896 | </xsl:when> |
|
|
897 | <xsl:otherwise> |
|
|
898 | <xsl:value-of select="@link"/> |
|
|
899 | </xsl:otherwise> |
|
|
900 | </xsl:choose> |
|
|
901 | </xsl:variable> |
| 834 | <br/> |
902 | <br/> |
| 835 | <a name="{$figid}"/> |
903 | <a name="{$figid}"/> |
| 836 | <table cellspacing="0" cellpadding="0" border="0"> |
904 | <table cellspacing="0" cellpadding="0" border="0"> |
| 837 | <tr> |
905 | <tr> |
| 838 | <td bgcolor="#7a5ada"> |
906 | <td bgcolor="#7a5ada"> |
| 839 | <p class="codetitle"> |
907 | <p class="codetitle"> |
|
|
908 | <xsl:choose> |
|
|
909 | <xsl:when test="@caption"> |
|
|
910 | <xsl:value-of select="func:gettext('Figure')"/> <xsl:value-of select="$chid"/>.<xsl:value-of select="$fignum"/><xsl:value-of select="func:gettext('SpaceBeforeColon')"/>: <xsl:value-of select="@caption"/> |
|
|
911 | </xsl:when> |
|
|
912 | <xsl:otherwise> |
|
|
913 | <xsl:value-of select="func:gettext('Figure')"/> <xsl:value-of select="$chid"/>.<xsl:value-of select="$fignum"/> |
|
|
914 | </xsl:otherwise> |
|
|
915 | </xsl:choose> |
|
|
916 | </p> |
|
|
917 | </td> |
|
|
918 | </tr> |
|
|
919 | <tr> |
|
|
920 | <td align="center" bgcolor="#ddddff"> |
| 840 | <xsl:choose> |
921 | <xsl:choose> |
| 841 | <xsl:when test="@caption"> |
922 | <xsl:when test="@short"> |
| 842 | <xsl:value-of select="func:gettext('Figure')"/> <xsl:value-of select="$chid"/>.<xsl:value-of select="$fignum"/><xsl:value-of select="func:gettext('SpaceBeforeColon')"/>: <xsl:value-of select="@caption"/> |
923 | <img src="{$llink}" alt="Fig. {$fignum}: {@short}"/> |
| 843 | </xsl:when> |
924 | </xsl:when> |
| 844 | <xsl:otherwise> |
925 | <xsl:otherwise> |
| 845 | <xsl:value-of select="func:gettext('Figure')"/> <xsl:value-of select="$chid"/>.<xsl:value-of select="$fignum"/> |
926 | <img src="{$llink}" alt="Fig. {$fignum}"/> |
| 846 | </xsl:otherwise> |
927 | </xsl:otherwise> |
| 847 | </xsl:choose> |
928 | </xsl:choose> |
| 848 | </p> |
|
|
| 849 | </td> |
929 | </td> |
| 850 | </tr> |
|
|
| 851 | <tr> |
|
|
| 852 | <td align="center" bgcolor="#ddddff"> |
|
|
| 853 | <xsl:choose> |
|
|
| 854 | <xsl:when test="@short"> |
|
|
| 855 | <img src="{$llink}" alt="Fig. {$fignum}: {@short}"/> |
|
|
| 856 | </xsl:when> |
|
|
| 857 | <xsl:otherwise> |
|
|
| 858 | <img src="{$llink}" alt="Fig. {$fignum}"/> |
|
|
| 859 | </xsl:otherwise> |
|
|
| 860 | </xsl:choose> |
|
|
| 861 | </td> |
930 | </tr> |
| 862 | </tr> |
|
|
| 863 | </table> |
931 | </table> |
| 864 | <br/> |
932 | <br/> |
| 865 | </xsl:template> |
933 | </xsl:template> |
| 866 | |
934 | |
| 867 | <!--figure without a caption; just a graphical element--> |
935 | <!--figure without a caption; just a graphical element--> |
| 868 | <xsl:template match="fig"> |
936 | <xsl:template match="fig"> |
| 869 | <xsl:variable name="llink"> |
937 | <xsl:variable name="llink"> |
| … | |
… | |
| 1013 | </font> |
1081 | </font> |
| 1014 | </xsl:template> |
1082 | </xsl:template> |
| 1015 | |
1083 | |
| 1016 | <!-- Body --> |
1084 | <!-- Body --> |
| 1017 | <xsl:template match="body"> |
1085 | <xsl:template match="body"> |
| 1018 | <xsl:param name="chid"/> |
|
|
| 1019 | <xsl:if test="not(@test) or dyn:evaluate(@test)"> |
1086 | <xsl:if test="not(@test) or dyn:evaluate(@test)"> |
| 1020 | <xsl:apply-templates> |
1087 | <xsl:choose> |
| 1021 | <xsl:with-param name="chid" select="$chid"/> |
1088 | <xsl:when test="include"> |
| 1022 | </xsl:apply-templates> |
1089 | <xsl:apply-templates select="document(include/@href)//body"/> |
|
|
1090 | </xsl:when> |
|
|
1091 | <xsl:otherwise> |
|
|
1092 | <xsl:apply-templates select="./*[not(@test) or dyn:evaluate(@test)]"/> |
|
|
1093 | </xsl:otherwise> |
|
|
1094 | </xsl:choose> |
| 1023 | </xsl:if> |
1095 | </xsl:if> |
| 1024 | </xsl:template> |
1096 | </xsl:template> |
| 1025 | |
1097 | |
| 1026 | <!-- Command or input, not to use inside <pre> --> |
1098 | <!-- Command or input, not to use inside <pre> --> |
| 1027 | <xsl:template match="c"> |
1099 | <xsl:template match="c"> |
| 1028 | <span class="code" dir="ltr"><xsl:apply-templates/></span> |
1100 | <span class="code" dir="ltr"><xsl:apply-templates/></span> |
| 1029 | </xsl:template> |
1101 | </xsl:template> |
| 1030 | |
1102 | |
| 1031 | <!-- Preserve whitespace, aka Code Listing --> |
1103 | <!-- Preserve whitespace, aka Code Listing --> |
| 1032 | <xsl:template match="pre"> |
1104 | <xsl:template match="pre"> |
| 1033 | <xsl:param name="chid"/> |
|
|
| 1034 | <xsl:if test="not(@test) or dyn:evaluate(@test)"> |
1105 | <xsl:if test="not(@test) or dyn:evaluate(@test)"> |
| 1035 | <xsl:variable name="prenum"><xsl:number level="any" from="chapter" count="pre[not(ancestor-or-self::*[@test and not(dyn:evaluate(@test))])]"/></xsl:variable> |
1106 | <xsl:variable name="uid" select="generate-id(.)" /> |
| 1036 | <xsl:variable name="preid">doc_chap<xsl:value-of select="$chid"/>_pre<xsl:value-of select="$prenum"/></xsl:variable> |
1107 | <xsl:variable name="chid"> |
|
|
1108 | <xsl:value-of select="1+count(exslt:node-set($doc-struct)//chapter[descendant::pre[@uid=$uid]]/preceding-sibling::chapter)"/> |
|
|
1109 | </xsl:variable> |
|
|
1110 | <xsl:variable name="prenum"> |
|
|
1111 | <xsl:value-of select="1+count(exslt:node-set($doc-struct)//chapter[descendant::pre[@uid=$uid]]//pre[following::pre[@uid=$uid]])"/> |
|
|
1112 | </xsl:variable> |
|
|
1113 | <xsl:variable name="preid"> |
|
|
1114 | <xsl:choose> |
|
|
1115 | <xsl:when test="($TTOP = 'book') and ($full != 0)"> |
|
|
1116 | <xsl:value-of select="concat('book_part', exslt:node-set($doc-struct)//bookpart[descendant::pre[@uid=$uid]]/@pos, '_chap', exslt:node-set($doc-struct)//bookchap[descendant::pre[@uid=$uid]]/@pos, '__chap', $chid, '_pre', $prenum)"/> |
|
|
1117 | </xsl:when> |
|
|
1118 | <xsl:otherwise> |
|
|
1119 | <xsl:value-of select="concat('doc_chap', $chid, '_pre', $prenum)"/> |
|
|
1120 | </xsl:otherwise> |
|
|
1121 | </xsl:choose> |
|
|
1122 | </xsl:variable> |
|
|
1123 | |
| 1037 | <a name="{$preid}"/> |
1124 | <a name="{$preid}"/> |
| 1038 | <table class="ntable" width="100%" cellspacing="0" cellpadding="0" border="0"> |
1125 | <table class="ntable" width="100%" cellspacing="0" cellpadding="0" border="0"> |
| 1039 | <tr> |
1126 | <tr> |
| 1040 | <td bgcolor="#7a5ada"> |
1127 | <td bgcolor="#7a5ada"> |
| 1041 | <p class="codetitle"> |
1128 | <p class="codetitle"> |
| … | |
… | |
| 1130 | #doc_part1_chap3 becomes #book_{UNIQUEID}_part1_chap3, but |
1217 | #doc_part1_chap3 becomes #book_{UNIQUEID}_part1_chap3, but |
| 1131 | #anything_else_like_an_ID is left unchanged (IDs are expected to be unique throughout a handbook)--> |
1218 | #anything_else_like_an_ID is left unchanged (IDs are expected to be unique throughout a handbook)--> |
| 1132 | <xsl:choose> |
1219 | <xsl:choose> |
| 1133 | <xsl:when test="starts-with(@link, '#doc_')"> |
1220 | <xsl:when test="starts-with(@link, '#doc_')"> |
| 1134 | <xsl:variable name="locallink" select="substring-after(@link, 'doc_')" /> |
1221 | <xsl:variable name="locallink" select="substring-after(@link, 'doc_')" /> |
| 1135 | <a href="#book_{generate-id(/)}_{$locallink}"><xsl:apply-templates /></a> |
1222 | <xsl:variable name="bodyid" select="generate-id(ancestor::body)"/> |
|
|
1223 | <a href="{concat('#book_part',exslt:node-set($doc-struct)//bookpart[descendant::body[@uid=$bodyid]]/@pos,'_chap',exslt:node-set($doc-struct)//bookchap[descendant::body[@uid=$bodyid]]/@pos,'__',$locallink)}"><xsl:apply-templates /></a> |
| 1136 | </xsl:when> |
1224 | </xsl:when> |
| 1137 | <xsl:otherwise> |
1225 | <xsl:otherwise> |
| 1138 | <a href="{@link}"><xsl:apply-templates/></a> |
1226 | <a href="{@link}"><xsl:apply-templates/></a> |
| 1139 | </xsl:otherwise> |
1227 | </xsl:otherwise> |
| 1140 | </xsl:choose> |
1228 | </xsl:choose> |
| … | |
… | |
| 1312 | <xsl:apply-templates/> |
1400 | <xsl:apply-templates/> |
| 1313 | </td> |
1401 | </td> |
| 1314 | </xsl:template> |
1402 | </xsl:template> |
| 1315 | |
1403 | |
| 1316 | <!-- Table Heading, no idea why <th> hasn't been used --> |
1404 | <!-- Table Heading, no idea why <th> hasn't been used --> |
|
|
1405 | <!-- 2008-03-09: th uses th, default is align:left for historical reasons --> |
| 1317 | <xsl:template match="th"> |
1406 | <xsl:template match="th"> |
| 1318 | <td class="infohead"> |
1407 | <th class="infohead"> |
|
|
1408 | <xsl:if test="@align='left' or @align='right'"> |
|
|
1409 | <xsl:attribute name="style"><xsl:value-of select="concat('text-align:',@align)"/></xsl:attribute> |
|
|
1410 | </xsl:if> |
| 1319 | <xsl:if test="@colspan"> |
1411 | <xsl:if test="@colspan"> |
| 1320 | <xsl:attribute name="colspan"><xsl:value-of select="@colspan"/></xsl:attribute> |
1412 | <xsl:attribute name="colspan"><xsl:value-of select="@colspan"/></xsl:attribute> |
| 1321 | <!-- Center only when item spans several columns as |
|
|
| 1322 | centering all <th> might disrupt some pages. |
|
|
| 1323 | We might want to use a plain html <th> tag later. |
|
|
| 1324 | Tip: to center a single-cell title, use <th colspan="1"> |
|
|
| 1325 | --> |
|
|
| 1326 | <xsl:attribute name="style">text-align:center</xsl:attribute> |
|
|
| 1327 | </xsl:if> |
1413 | </xsl:if> |
| 1328 | <xsl:if test="@rowspan"> |
1414 | <xsl:if test="@rowspan"> |
| 1329 | <xsl:attribute name="rowspan"><xsl:value-of select="@rowspan"/></xsl:attribute> |
1415 | <xsl:attribute name="rowspan"><xsl:value-of select="@rowspan"/></xsl:attribute> |
| 1330 | </xsl:if> |
1416 | </xsl:if> |
| 1331 | <b> |
1417 | <b> |
| 1332 | <xsl:apply-templates/> |
1418 | <xsl:apply-templates/> |
| 1333 | </b> |
1419 | </b> |
| 1334 | </td> |
1420 | </th> |
| 1335 | </xsl:template> |
1421 | </xsl:template> |
| 1336 | |
1422 | |
| 1337 | <!-- Unnumbered List --> |
1423 | <!-- Unnumbered List --> |
| 1338 | <xsl:template match="ul"> |
1424 | <xsl:template match="ul"> |
| 1339 | <xsl:if test="not(@test) or dyn:evaluate(@test)"> |
1425 | <xsl:if test="not(@test) or dyn:evaluate(@test)"> |
| … | |
… | |
| 1451 | |
1537 | |
| 1452 | <!-- Compare versions between two documents, scan handbooks if need be --> |
1538 | <!-- Compare versions between two documents, scan handbooks if need be --> |
| 1453 | <xsl:template name="compare-versions"> |
1539 | <xsl:template name="compare-versions"> |
| 1454 | <xsl:param name="original"/> |
1540 | <xsl:param name="original"/> |
| 1455 | <xsl:param name="translation"/> |
1541 | <xsl:param name="translation"/> |
|
|
1542 | |
| 1456 | <xsl:choose> |
1543 | <xsl:choose> |
| 1457 | <xsl:when test="$original/book and $translation/book"> |
1544 | <xsl:when test="$original/doc-struct/@type != $translation/doc-struct/@type"> |
| 1458 | <!-- /book == /book --> |
1545 | <xsl:text>NoOriginal</xsl:text> |
| 1459 | <xsl:choose> |
|
|
| 1460 | <xsl:when test="$full != 0"> |
|
|
| 1461 | <!-- if full != 0, then compare all files --> |
|
|
| 1462 | <!-- Compare versions in master files --> |
|
|
| 1463 | <xsl:if test="$original/book/version != $translation/book/version">X</xsl:if> |
|
|
| 1464 | <!-- Compare versions in original chapters vs. translated chapters that have the same position --> |
|
|
| 1465 | <xsl:for-each select="$original/book/part"> |
|
|
| 1466 | <xsl:variable name="part" select="position()"/> |
|
|
| 1467 | <xsl:for-each select="chapter"> |
|
|
| 1468 | <xsl:variable name="chap" select="position()"/> |
|
|
| 1469 | <xsl:variable name="ov" select="document($original/book/part[$part]/chapter[$chap]/include/@href)/sections/version"/> |
|
|
| 1470 | <xsl:variable name="tv" select="document($translation/book/part[$part]/chapter[$chap]/include/@href)/sections/version"/> |
|
|
| 1471 | <xsl:if test="$ov != $tv or not($tv)">X</xsl:if> |
|
|
| 1472 | </xsl:for-each> |
|
|
| 1473 | </xsl:for-each> |
|
|
| 1474 | </xsl:when> |
|
|
| 1475 | <xsl:when test="$part = '0' or $chap = '0'"> |
|
|
| 1476 | <!-- Table of contents, check master file --> |
|
|
| 1477 | <xsl:if test="$original/book/version != $translation/book/version">X</xsl:if> |
|
|
| 1478 | </xsl:when> |
|
|
| 1479 | <xsl:otherwise> |
|
|
| 1480 | <!-- Compare chapters at same position (/$part/$chap/) in English handbook and in translated one --> |
|
|
| 1481 | <xsl:variable name="ov" select="document($original/book/part[position()=$part]/chapter[position()=$chap]/include/@href)/sections/version"/> |
|
|
| 1482 | <xsl:variable name="tv" select="document($translation/book/part[position()=$part]/chapter[position()=$chap]/include/@href)/sections/version"/> |
|
|
| 1483 | <xsl:if test="$ov != $tv or not($tv)">X</xsl:if> |
|
|
| 1484 | </xsl:otherwise> |
|
|
| 1485 | </xsl:choose> |
|
|
| 1486 | </xsl:when> |
1546 | </xsl:when> |
| 1487 | <xsl:when test="$original/guide and $translation/guide"> |
1547 | |
| 1488 | <!-- /guide == /guide --> |
1548 | <xsl:when test="/book and $full='0' and $chap != '0' and $part != '0' and not($original/doc-struct/bookpart[@pos=$part]/bookchap[@pos=$chap])"> |
| 1489 | <xsl:if test="$original/guide/version != $translation/guide/version">X</xsl:if> |
1549 | <xsl:text>NoOriginal</xsl:text> |
| 1490 | </xsl:when> |
1550 | </xsl:when> |
| 1491 | <xsl:when test="$original/mainpage and $translation/mainpage"> |
1551 | |
| 1492 | <!-- /guide == /guide --> |
1552 | <xsl:otherwise> |
| 1493 | <xsl:if test="$original/mainpage/version != $translation/mainpage/version">X</xsl:if> |
1553 | <xsl:variable name="orig-versions"> |
| 1494 | </xsl:when> |
1554 | <xsl:for-each select="$original//version"> |
| 1495 | <!-- If we did not compare book==book, mainpage==mainpage or guide==guide, then consider versions are different --> |
1555 | <xsl:value-of select="concat(.,' ')"/> |
| 1496 | <xsl:otherwise>X</xsl:otherwise> |
1556 | </xsl:for-each> |
|
|
1557 | </xsl:variable> |
|
|
1558 | |
|
|
1559 | <xsl:variable name="trans-versions"> |
|
|
1560 | <xsl:for-each select="$translation//version"> |
|
|
1561 | <xsl:value-of select="concat(.,' ')"/> |
|
|
1562 | </xsl:for-each> |
|
|
1563 | </xsl:variable> |
|
|
1564 | |
|
|
1565 | <xsl:if test="$orig-versions != $trans-versions">Different</xsl:if> |
|
|
1566 | </xsl:otherwise> |
| 1497 | </xsl:choose> |
1567 | </xsl:choose> |
| 1498 | </xsl:template> |
|
|
| 1499 | |
1568 | |
| 1500 | <!-- Return the date of a document, for handbooks, it is the max(main file date, all included parts dates) --> |
1569 | </xsl:template> |
|
|
1570 | |
| 1501 | <xsl:template name="maxdate"> |
1571 | <xsl:template name="maxdate"> |
| 1502 | <xsl:param name="thedoc"/> |
1572 | <xsl:param name="thedoc"/> |
| 1503 | <xsl:choose> |
1573 | <xsl:for-each select="$thedoc//date"> |
| 1504 | <xsl:when test="$thedoc/book"> |
|
|
| 1505 | <!-- In a book: look for max(/date, include_files/sections/date) --> |
|
|
| 1506 | <xsl:for-each select="$thedoc/book/part/chapter/include"> |
|
|
| 1507 | <xsl:sort select="document(@href)/sections/date" order="descending" /> |
|
|
| 1508 | <xsl:if test="position() = 1"> |
|
|
| 1509 | <!-- Compare the max(date) from included files with the date in the master file |
|
|
| 1510 | Of course, XSLT 1.0 knows no string comparison operator :-( |
|
|
| 1511 | So we build a node set with the two dates and we sort it. |
|
|
| 1512 | --> |
|
|
| 1513 | <xsl:variable name="theDates"> |
|
|
| 1514 | <xsl:element name="bookDate"> |
|
|
| 1515 | <xsl:value-of select="$thedoc/book/date"/> |
|
|
| 1516 | </xsl:element> |
|
|
| 1517 | <xsl:element name="maxChapterDate"> |
|
|
| 1518 | <xsl:value-of select="document(@href)/sections/date"/> |
|
|
| 1519 | </xsl:element> |
|
|
| 1520 | </xsl:variable> |
|
|
| 1521 | <xsl:variable name="sortedDates"> |
|
|
| 1522 | <xsl:for-each select="exslt:node-set($theDates)/*"> |
|
|
| 1523 | <xsl:sort select="." order="descending" /> |
1574 | <xsl:sort select="." order="descending" /> |
| 1524 | <xsl:copy-of select="."/> |
1575 | <xsl:if test="position()=1"><xsl:value-of select="."/></xsl:if> |
| 1525 | </xsl:for-each> |
|
|
| 1526 | </xsl:variable> |
|
|
| 1527 | <!-- First date is the one we want --> |
|
|
| 1528 | <xsl:value-of select="exslt:node-set($sortedDates)/*[position()=1]"/> |
|
|
| 1529 | </xsl:if> |
|
|
| 1530 | </xsl:for-each> |
1576 | </xsl:for-each> |
| 1531 | </xsl:when> |
|
|
| 1532 | <xsl:when test="$thedoc/guide or $thedoc/sections or $thedoc/mainpage or $thedoc/news"> |
|
|
| 1533 | <xsl:value-of select="$thedoc/*[1]/date"/> |
|
|
| 1534 | </xsl:when> |
|
|
| 1535 | </xsl:choose> |
|
|
| 1536 | </xsl:template> |
1577 | </xsl:template> |
| 1537 | |
1578 | |
| 1538 | <xsl:template name="contentdate"> |
1579 | <xsl:template name="contentdate"> |
| 1539 | <xsl:variable name="docdate"> |
1580 | <xsl:variable name="docdate"> |
| 1540 | <xsl:call-template name="maxdate"> |
1581 | <xsl:call-template name="maxdate"> |
| 1541 | <xsl:with-param name="thedoc" select="/"/> |
1582 | <xsl:with-param name="thedoc" select="exslt:node-set($doc-struct)"/> |
| 1542 | </xsl:call-template> |
1583 | </xsl:call-template> |
| 1543 | </xsl:variable> |
1584 | </xsl:variable> |
| 1544 | |
1585 | |
| 1545 | <xsl:choose> |
1586 | <xsl:choose> |
| 1546 | <xsl:when test="func:gettext('Updated')/docdate"> |
1587 | <xsl:when test="func:gettext('Updated')/docdate"> |
| … | |
… | |
| 1573 | <xsl:value-of select="func:gettext('NoOriginal')"/> |
1614 | <xsl:value-of select="func:gettext('NoOriginal')"/> |
| 1574 | </xsl:when> |
1615 | </xsl:when> |
| 1575 | <xsl:otherwise> |
1616 | <xsl:otherwise> |
| 1576 | <!-- Document is listed in both local metadoc.xml and English one, compare version numbers --> |
1617 | <!-- Document is listed in both local metadoc.xml and English one, compare version numbers --> |
| 1577 | <xsl:variable name="pfile" select="$pmetadoc/metadoc/files/file[@id=$fileid]"/> |
1618 | <xsl:variable name="pfile" select="$pmetadoc/metadoc/files/file[@id=$fileid]"/> |
|
|
1619 | |
|
|
1620 | <xsl:variable name="orig-struct" xmlns=""> |
|
|
1621 | <xsl:call-template name="build-doc-struct"> |
|
|
1622 | <xsl:with-param name="doc" select="document($pfile)"/> |
|
|
1623 | </xsl:call-template> |
|
|
1624 | </xsl:variable> |
|
|
1625 | |
| 1578 | <xsl:variable name="versions"> |
1626 | <xsl:variable name="versions"> |
| 1579 | <xsl:call-template name="compare-versions"> |
1627 | <xsl:call-template name="compare-versions"> |
| 1580 | <xsl:with-param name="original" select ="document($pfile)"/> |
|
|
| 1581 | <xsl:with-param name="translation" select ="/"/> |
1628 | <xsl:with-param name="translation" select ="exslt:node-set($doc-struct)"/> |
|
|
1629 | <xsl:with-param name="original" select ="exslt:node-set($orig-struct)"/> |
| 1582 | </xsl:call-template> |
1630 | </xsl:call-template> |
| 1583 | </xsl:variable> |
1631 | </xsl:variable> |
| 1584 | <xsl:if test="string-length($versions) > 0"> |
1632 | |
|
|
1633 | <xsl:choose> |
|
|
1634 | <xsl:when test="$versions = 'Different'"> |
| 1585 | <xsl:variable name="pdocdate"> |
1635 | <xsl:variable name="pdocdate"> |
| 1586 | <xsl:call-template name="maxdate"> |
1636 | <xsl:call-template name="maxdate"> |
| 1587 | <xsl:with-param name="thedoc" select="document($pfile)"/> |
1637 | <xsl:with-param name="thedoc" select="exslt:node-set($orig-struct)"/> |
| 1588 | </xsl:call-template> |
1638 | </xsl:call-template> |
| 1589 | </xsl:variable> |
1639 | </xsl:variable> |
| 1590 | <xsl:variable name="res"> |
1640 | <xsl:variable name="res"> |
| 1591 | <xsl:apply-templates select="func:gettext('Outdated')"> |
1641 | <xsl:apply-templates select="func:gettext('Outdated')"> |
| 1592 | <xsl:with-param name="docdate" select="$pdocdate"/> |
1642 | <xsl:with-param name="docdate" select="$pdocdate"/> |
| 1593 | <xsl:with-param name="paramlink" select="$pfile"/> |
1643 | <xsl:with-param name="paramlink" select="$pfile"/> |
| 1594 | </xsl:apply-templates> |
1644 | </xsl:apply-templates> |
| 1595 | </xsl:variable> |
1645 | </xsl:variable> |
| 1596 | <xsl:copy-of select="$res"/> |
1646 | <xsl:copy-of select="$res"/> |
| 1597 | </xsl:if> |
1647 | </xsl:when> |
|
|
1648 | <xsl:when test="contains($versions,'NoOriginal')"> |
|
|
1649 | <xsl:value-of select="func:gettext('NoOriginal')"/> |
|
|
1650 | </xsl:when> |
|
|
1651 | </xsl:choose> |
| 1598 | </xsl:otherwise> |
1652 | </xsl:otherwise> |
| 1599 | </xsl:choose> |
1653 | </xsl:choose> |
| 1600 | </xsl:otherwise> |
1654 | </xsl:otherwise> |
| 1601 | </xsl:choose> |
1655 | </xsl:choose> |
| 1602 | </xsl:if> |
1656 | </xsl:if> |
| … | |
… | |
| 1608 | </xsl:template> |
1662 | </xsl:template> |
| 1609 | |
1663 | |
| 1610 | |
1664 | |
| 1611 | <xsl:template name="rhcol"> |
1665 | <xsl:template name="rhcol"> |
| 1612 | <!-- Right-hand column with date/authors/ads --> |
1666 | <!-- Right-hand column with date/authors/ads --> |
|
|
1667 | |
|
|
1668 | <xsl:variable name="images"> |
|
|
1669 | <!-- Source images from www.gentoo.org when on another server to |
|
|
1670 | prevent missing images after an update --> |
|
|
1671 | <xsl:choose> |
|
|
1672 | <xsl:when test="$httphost != 'www'">http://www.gentoo.org/</xsl:when> |
|
|
1673 | <xsl:otherwise> |
|
|
1674 | <xsl:value-of select="$ROOT"/> |
|
|
1675 | </xsl:otherwise> |
|
|
1676 | </xsl:choose> |
|
|
1677 | </xsl:variable> |
|
|
1678 | |
| 1613 | <table border="0" cellspacing="4px" cellpadding="4px"> |
1679 | <table border="0" cellspacing="4px" cellpadding="4px"> |
| 1614 | <!-- Add a "printer-friendly" button when link attribute exists --> |
1680 | <!-- Add a "printer-friendly" button when link attribute exists --> |
| 1615 | <xsl:if test="/book or /guide"> |
1681 | <xsl:if test="/book or /guide"> |
| 1616 | <tr> |
1682 | <tr> |
| 1617 | <td class="topsep" align="center"> |
1683 | <td class="topsep" align="center"> |
| … | |
… | |
| 1737 | |
1803 | |
| 1738 | <input type="image" src="http://images.paypal.com/images/x-click-but21.gif" name="submit" alt="Donate to Gentoo"/> |
1804 | <input type="image" src="http://images.paypal.com/images/x-click-but21.gif" name="submit" alt="Donate to Gentoo"/> |
| 1739 | </form> |
1805 | </form> |
| 1740 | </td> |
1806 | </td> |
| 1741 | </tr> |
1807 | </tr> |
|
|
1808 | <!-- OSL --> |
|
|
1809 | <tr lang="en"> |
|
|
1810 | <td align="center" class="topsep"> |
|
|
1811 | <a href="http://osuosl.org/contribute"> |
|
|
1812 | <img src="{concat($images,'images/osuosl.png')}" width="125" height="50" alt="Support OSL" border="0"/> |
|
|
1813 | </a> |
|
|
1814 | <p class="alttext"> |
|
|
1815 | <a href="http://osuosl.org/contribute">Support OSL</a> |
|
|
1816 | </p> |
|
|
1817 | </td> |
|
|
1818 | </tr> |
|
|
1819 | <!-- /OSL --> |
|
|
1820 | <!-- VR --> |
| 1742 | <tr lang="en"> |
1821 | <tr lang="en"> |
| 1743 | <td align="center" class="topsep"> |
1822 | <td align="center" class="topsep"> |
| 1744 | <a href="http://www.vr.org"> |
1823 | <a href="http://www.vr.org"> |
| 1745 | <img src="{concat($ROOT,'images/vr-ad.png')}" width="125" height="144" alt="Gentoo Centric Hosting: vr.org" border="0"/> |
1824 | <img src="{concat($images,'images/vr-ad.png')}" width="125" height="144" alt="Gentoo Centric Hosting: vr.org" border="0"/> |
| 1746 | </a> |
1825 | </a> |
| 1747 | <p class="alttext"> |
1826 | <p class="alttext"> |
| 1748 | <a href="http://www.vr.org/">VR Hosted</a> |
1827 | <a href="http://www.vr.org/">VR Hosted</a> |
| 1749 | </p> |
1828 | </p> |
| 1750 | </td> |
1829 | </td> |
| 1751 | </tr> |
1830 | </tr> |
|
|
1831 | <!-- /VR --> |
|
|
1832 | <!-- Tek --> |
| 1752 | <tr lang="en"> |
1833 | <tr lang="en"> |
| 1753 | <td align="center" class="topsep"> |
1834 | <td align="center" class="topsep"> |
| 1754 | <a href="http://www.tek.net" target="_top"> |
1835 | <a href="http://www.tek.net" target="_top"> |
| 1755 | <img src="{concat($ROOT,'images/tek-gentoo.gif')}" width="125" height="125" alt="Tek Alchemy" border="0"/> |
1836 | <img src="{concat($images,'images/tek-gentoo.gif')}" width="125" height="125" alt="Tek Alchemy" border="0"/> |
| 1756 | </a> |
1837 | </a> |
| 1757 | <p class="alttext"> |
1838 | <p class="alttext"> |
| 1758 | <a href="http://www.tek.net/">Tek Alchemy</a> |
1839 | <a href="http://www.tek.net/">Tek Alchemy</a> |
| 1759 | </p> |
1840 | </p> |
| 1760 | </td> |
1841 | </td> |
| 1761 | </tr> |
1842 | </tr> |
|
|
1843 | <!-- /Tek --> |
|
|
1844 | <!-- SevenL --> |
| 1762 | <tr lang="en"> |
1845 | <tr lang="en"> |
| 1763 | <td align="center" class="topsep"> |
1846 | <td align="center" class="topsep"> |
| 1764 | <a href="http://www.sevenl.net" target="_top"> |
1847 | <a href="http://www.sevenl.net" target="_top"> |
| 1765 | <img src="{concat($ROOT,'images/sponsors/sevenl.gif')}" width="125" height="144" alt="SevenL.net" border="0"/> |
1848 | <img src="{concat($images,'images/sponsors/sevenl.gif')}" width="125" height="144" alt="SevenL.net" border="0"/> |
| 1766 | </a> |
1849 | </a> |
| 1767 | <p class="alttext"> |
1850 | <p class="alttext"> |
| 1768 | <a href="http://www.sevenl.net/">SevenL.net</a> |
1851 | <a href="http://www.sevenl.net/">SevenL.net</a> |
| 1769 | </p> |
1852 | </p> |
| 1770 | </td> |
1853 | </td> |
| 1771 | </tr> |
1854 | </tr> |
|
|
1855 | <!-- /SevenL --> |
|
|
1856 | <!-- GNi --> |
| 1772 | <tr lang="en"> |
1857 | <tr lang="en"> |
| 1773 | <td align="center" class="topsep"> |
1858 | <td align="center" class="topsep"> |
| 1774 | <a href="http://www.phparch.com/bannerclick.php?AID=68&BID=1&BT=127929" target="_top"> |
1859 | <a href="http://www.gni.com" target="_top"> |
| 1775 | <img src="{concat($ROOT,'images/phpa-gentoo.gif')}" width="125" height="144" alt="php|architect" border="0"/> |
1860 | <img src="{concat($images,'images/gni_logo.png')}" width="125" alt="Global Netoptex Inc." border="0"/> |
| 1776 | </a> |
1861 | </a> |
| 1777 | <p class="alttext"> |
1862 | <p class="alttext"> |
| 1778 | <a href="http://www.phparch.com/bannerclick.php?AID=68&BID=1&BT=127929">php|architect</a> |
1863 | <a href="http://www.gni.com">Global Netoptex Inc.</a> |
| 1779 | </p> |
1864 | </p> |
| 1780 | </td> |
1865 | </td> |
| 1781 | </tr> |
1866 | </tr> |
|
|
1867 | <!-- /GNi --> |
|
|
1868 | <!-- bytemark --> |
|
|
1869 | <tr lang="en"> |
|
|
1870 | <td align="center" class="topsep"> |
|
|
1871 | <a href="http://www.bytemark.co.uk/r/gentoo-home" target="_top"> |
|
|
1872 | <img src="{concat($images,'images/sponsors/bytemark_ad.png')}" width="125" alt="Bytemark" border="0"/> |
|
|
1873 | </a> |
|
|
1874 | <p class="alttext"> |
|
|
1875 | <a href="http://www.bytemark.co.uk/r/gentoo-home">Bytemark</a> |
|
|
1876 | </p> |
|
|
1877 | </td> |
|
|
1878 | </tr> |
|
|
1879 | <!-- /bytemark --> |
| 1782 | <tr> |
1880 | <tr> |
| 1783 | <td align="center" class="topsep"/> |
1881 | <td align="center" class="topsep"/> |
| 1784 | </tr> |
1882 | </tr> |
| 1785 | </table> |
1883 | </table> |
| 1786 | </xsl:template> |
1884 | </xsl:template> |
| … | |
… | |
| 1794 | <p class="newshead" lang="en"> |
1892 | <p class="newshead" lang="en"> |
| 1795 | <b><xsl:value-of select="$thenews/title"/></b> |
1893 | <b><xsl:value-of select="$thenews/title"/></b> |
| 1796 | <br/> |
1894 | <br/> |
| 1797 | <font size="0.90em"> |
1895 | <font size="0.90em"> |
| 1798 | Posted on <xsl:copy-of select="func:format-date($thenews/date)"/> |
1896 | Posted on <xsl:copy-of select="func:format-date($thenews/date)"/> |
|
|
1897 | <xsl:variable name="poster"> |
|
|
1898 | <xsl:call-template name="smart-mail"> |
|
|
1899 | <xsl:with-param name="mail" select="$thenews/poster"/> |
|
|
1900 | </xsl:call-template> |
|
|
1901 | </xsl:variable> |
| 1799 | by <xsl:value-of select="$thenews/poster"/> |
1902 | by <xsl:value-of select="$poster"/> |
| 1800 | </font> |
1903 | </font> |
| 1801 | </p> |
1904 | </p> |
| 1802 | |
1905 | |
| 1803 | <xsl:choose> |
1906 | <xsl:choose> |
| 1804 | <xsl:when test="$thenews/@category='alpha'"> |
1907 | <xsl:when test="$thenews/@category='alpha'"> |
| … | |
… | |
| 1846 | </xsl:choose> |
1949 | </xsl:choose> |
| 1847 | </div> |
1950 | </div> |
| 1848 | </div> |
1951 | </div> |
| 1849 | </xsl:template> |
1952 | </xsl:template> |
| 1850 | |
1953 | |
| 1851 | |
|
|
| 1852 | </xsl:stylesheet> |
1954 | </xsl:stylesheet> |