Hello community, here is the log from the commit of package suse-xsl-stylesheets for openSUSE:Factory checked in at 2013-01-17 10:50:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/suse-xsl-stylesheets (Old) and /work/SRC/openSUSE:Factory/.suse-xsl-stylesheets.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "suse-xsl-stylesheets", Maintainer is "thomas.schrai...@suse.com" Changes: -------- --- /work/SRC/openSUSE:Factory/suse-xsl-stylesheets/suse-xsl-stylesheets.changes 2013-01-08 21:13:27.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.suse-xsl-stylesheets.new/suse-xsl-stylesheets.changes 2013-01-17 10:51:00.000000000 +0100 @@ -1,0 +2,16 @@ +Tue Jan 16 08:45:00 UTC 2013 - t...@opensuse.org + +Version 1.9.15: +* Schema + - qandaset are included in a section; that means, no title in qandaset + is useful + - qandadiv can still contain a title, but it contains only qandaentrys + - question must always start with a para; after this para other + elements are allowed + - qandaentry requires one question and one answer in this order + +SPEC file: +* Used font requirements from daps.spec; see ticket#116 +* Added additional check for 12.1 to avoid the "have choice" error + +------------------------------------------------------------------- Old: ---- suse-xsl-stylesheets-1.9.14.tar.bz2 New: ---- suse-xsl-stylesheets-1.9.15.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ suse-xsl-stylesheets.spec ++++++ --- /var/tmp/diff_new_pack.Q5jwCd/_old 2013-01-17 10:51:01.000000000 +0100 +++ /var/tmp/diff_new_pack.Q5jwCd/_new 2013-01-17 10:51:01.000000000 +0100 @@ -15,9 +15,8 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # - Name: suse-xsl-stylesheets -Version: 1.9.14 +Version: 1.9.15 Release: 0 %define dtdversion 1.0 @@ -37,22 +36,21 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch -BuildRequires: bzip2 BuildRequires: docbook-xsl-stylesheets >= 1.75 BuildRequires: fdupes BuildRequires: libxslt BuildRequires: make BuildRequires: trang -Requires: docbook -Requires: docbook-xsl-stylesheets >= 1.75 -Requires: libxslt - # Only needed to fix the "have choice" error between xerces-j2 and crimson %if 0%{?suse_version} == 1210 BuildRequires: xerces-j2 %endif +Requires: docbook +Requires: docbook-xsl-stylesheets >= 1.75 +Requires: libxslt + Recommends: daps Recommends: docbook5 Recommends: docbook5-xsl-stylesheets ++++++ suse-xsl-stylesheets-1.9.14.tar.bz2 -> suse-xsl-stylesheets-1.9.15.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/suse-xsl-stylesheets/schema/novdocx.dtd new/suse-xsl-stylesheets/schema/novdocx.dtd --- old/suse-xsl-stylesheets/schema/novdocx.dtd 2013-01-07 11:04:07.000000000 +0100 +++ new/suse-xsl-stylesheets/schema/novdocx.dtd 2013-01-15 16:57:28.000000000 +0100 @@ -257,21 +257,21 @@ <!ELEMENT textobject (phrase) > <!-- QandASet --> -<!ELEMENT qandaset (title?, (remark|indexterm)*, (qandadiv+|qandaentry+)) > +<!ELEMENT qandaset ((remark|indexterm)*, (qandadiv+|qandaentry+)) > <!ATTLIST qandaset defaultlabel (none | number | qanda) #IMPLIED %profiling.attributes; %xmlbase;> -<!ELEMENT qandadiv (title?, (remark|indexterm)*, (qandadiv+|qandaentry+))> +<!ELEMENT qandadiv (title?, (remark|indexterm)*, qandaentry+)> <!ATTLIST qandadiv %profiling.attributes; %xmlbase; > -<!ELEMENT qandaentry (question,answer*)> +<!ELEMENT qandaentry (question,answer)> <!ATTLIST qandaentry %profiling.attributes; %xmlbase;> -<!ELEMENT question (label?, (calloutlist|itemizedlist|orderedlist| +<!ELEMENT question (label?, para, (calloutlist|itemizedlist|orderedlist| variablelist|important|note| tip|warning|screen|formalpara|para|mediaobject| informalfigure|informaltable| - example|figure|table|procedure|remark|indexterm)+)> + example|figure|table|procedure|remark|indexterm)*)> <!ATTLIST question %profiling.attributes; %xmlbase;> <!ELEMENT answer (label?, (calloutlist|itemizedlist|orderedlist| diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/suse-xsl-stylesheets/xslt_suse2/static/css/susebooks.css new/suse-xsl-stylesheets/xslt_suse2/static/css/susebooks.css --- old/suse-xsl-stylesheets/xslt_suse2/static/css/susebooks.css 2012-12-20 15:44:24.000000000 +0100 +++ new/suse-xsl-stylesheets/xslt_suse2/static/css/susebooks.css 2013-01-15 13:31:47.000000000 +0100 @@ -3,8 +3,10 @@ For additional support for Vietnamese, add "vietnamese," after "&subset=". Additional available weights are Book ("300,300italic"), Semi-bold ("500, 500italic"), and Extra-bold ("800,800italic"). Consider page load time. +Ideally, we could append &text=... and add a few common Greek characters, like +alpha, beta, ... but that doesn't work together with the subset option. */ -@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,600italic,400italic&subset=latin,cyrillic-ext,latin-ext,greek); +@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,400italic,600italic&subset=latin-ext,cyrillic); /* Reset everything */ /* From http://meyerweb.com/eric/tools/css/reset/, v2.0, modified */ @@ -259,7 +261,8 @@ background-position: 0px 0px; } -#_header .book-icon:hover, #_header .book-icon:focus, #_header .book-icon:active { +#_header a:hover .book-icon, #_header a:focus .book-icon, +#_header a:active .book-icon { background-position: 0px -36px; } @@ -274,7 +277,8 @@ width: 18px; } -#_fixed-header .book-icon:hover, #_fixed-header .book-icon:focus, #_fixed-header .book-icon:active { +#_fixed-header a:hover .book-icon, #_fixed-header a:focus .book-icon, +#_fixed-header a:active .book-icon { background-position: -18px -72px; } @@ -619,6 +623,12 @@ line-height: 22px; } +.bubble a:hover .keycap, .bubble a:focus .keycap, .bubble a:active .keycap, +.bubble a:hover .command, .bubble a:focus .command, .bubble a:active .command, +.bubble a:hover code, .bubble a:focus code, .bubble a:active code { + border-color: #FFF; +} + #_bubble-toc .active ol { display: block; position: absolute; @@ -794,7 +804,7 @@ } #_fixed-header div.button { - margin-left: 10px;; + margin-left: 10px; } #_fixed-header .buttons .tool-spacer { @@ -808,6 +818,7 @@ #_fixed-header .prev-icon, #_fixed-header .next-icon { width: 18px; + margin: 1px 0; display: block; } @@ -894,7 +905,7 @@ display: block; float: left; color: #333; - overflow: ellipsis; + text-overflow: ellipsis; height: 36px; } @@ -986,6 +997,7 @@ padding: 20px 0 0 0; border-top: 1px solid #999; clear: both; + display: none; } .offline .online-contents { @@ -1186,21 +1198,24 @@ clear: both; } -.sect1 .title, .single .sect1 .title { +.sect1 .title, .single .sect1 .title, +.chapter .qandaset .title, .preface .qandaset .title, .appendix .qandaset .title, +.bibliography .qandaset .title, .reference .qandaset .title, +.part .qandaset .title, .glossary .qandaset .title { font-size: 28px; font-weight: normal; padding: 50px 0 5px; text-align: left; } -.sect2 .title, .single .sect2 .title { +.sect2 .title, .single .sect2 .title, .sect1 .qandaset .title { font-size: 22px; padding: 40px 0 0; text-align: left; } .sect3 .title, .single .sect3 .title, -.refentry h2, h2, .indexdiv h3 { +.sect2 .qandaset .title, .refentry h2, h2, .indexdiv h3 { font-size: 20px; font-weight: normal; padding: 33px 0 0; @@ -1226,11 +1241,11 @@ font-weight: normal; } -.name, .refentry h2, .refentrytitle a, h2, .indexdiv h3 { +.name, .refentry h2, .refentrytitle a, h2, .indexdiv h3, .qandadiv-title, +.qandaset .title { color: #439539; } -/*BR*/ a:hover .name, a:focus .name, a:active .name, .refentrytitle a:hover, .refentrytitle a:focus, .refentrytitle a:active { text-decoration: underline; @@ -1316,10 +1331,10 @@ .note { border-color: #666; - background: #FFF url(../images/dots-yellow.png) repeat-x scroll top; + background: #FFF url(../images/dots-darkgray.png) repeat-x scroll top; } -.note ul { +.note ul, .note .orderedlist, .warning ul, .warning .orderedlist { color: #666; } @@ -1328,7 +1343,7 @@ background: #FFF url(../images/dots-orange.png) repeat-x scroll top; } -.important ul { +.important ul, .important .orderedlist { color: #BB7B03; } @@ -1337,30 +1352,26 @@ background: #FFF url(../images/dots-red.png) repeat-x scroll top; } -.warning ul, .warning ul { - color: #333; -} - -.admonition h6 { +.admonition > h6 { font-weight: 600; vertical-align: middle; display: table-cell; height: 36px; } -.tip h6 { +.tip > h6 { color: #439539; } -.note h6 { +.note > h6 { color: #333; } -.important h6 { +.important > h6 { color: #BB7B03; } -.warning h6, .caution h6 { +.warning > h6, .caution > h6 { color: #8C0000; } @@ -1434,33 +1445,33 @@ margin: 10px 0 0; } -.abstract { +.abstract, .highlights { margin: 24px 0 0; font-size: 18px; line-height: 140%; } -.abstract p, .toc-title { +.abstract p, .highlights p, .toc-title { color: #333; } -.abstract p:first-child { +.abstract p:first-child, .highlights p:first-child { margin-top: 0; } -.abstract .titlepage { +.abstract .titlepage, .highlights .titlepage { display: none; } -.abstract .titlepage + p { +.abstract .titlepage + p, .highlights .titlepage + p { margin-top: 0; } -.abstract li:first-child p:first-child { +.abstract li:first-child p:first-child, .highlights li:first-child p:first-child { margin-top: 0; } -.abstract + .authorgroup { +.abstract + .authorgroup, .highlights + .authorgroup { margin: 10px 0; } @@ -1469,24 +1480,20 @@ } .ulink, .link, .xref, .email, .glosssee, -.glossseealso, .indexterm { +.glossseealso, .indexterm, .qanda-toc a { color: #439539; text-decoration: none; } -.title .xref, .subtitle .xref, .table-title .xref, -.example-title .xref, .figure-title .xref, -.procedure-title .xref, .orderedlist-title .xref, -.itemizedlist-title .xref, .variablelist-title .xref, -.title .link, .subtitle .link, .table-title .link, -.example-title .link, .figure-title .link, -.procedure-title .link, .orderedlist-title .link, -.itemizedlist-title .link, .variablelist-title .link, -.title .ulink, .subtitle .ulink, -.table-title .ulink, .example-title .ulink, -.figure-title .ulink, .procedure-title .ulink, -.orderedlist-title .ulink, .itemizedlist-title .ulink, -.variablelist-title .ulink { +.title .xref, .subtitle .xref, .table-title .xref, .example-title .xref, +.figure-title .xref, .procedure-title .xref, .orderedlist-title .xref, +.itemizedlist-title .xref, .variablelist-title .xref, .qandadiv-title .xref, +.title .link, .subtitle .link, .table-title .link, .example-title .link, +.figure-title .link, .procedure-title .link, .orderedlist-title .link, +.itemizedlist-title .link, .variablelist-title .link, .qandadiv-title .link, +.title .ulink, .subtitle .ulink, .table-title .ulink, .example-title .ulink, +.figure-title .ulink, .procedure-title .ulink, .orderedlist-title .ulink, +.itemizedlist-title .ulink, .variablelist-title .ulink, .qandadiv-title .ulink { text-decoration: underline; } @@ -1503,7 +1510,9 @@ .glossseealso:hover, .glossseealso:focus, .glossseealso:active, .glossseealso:visited:hover, .glossseealso:visited:focus, .glossseealso:visited:active, .indexterm:hover, .indexterm:focus, .indexterm:active, -.indexterm:visited:hover, .indexterm:visited:focus, .indexterm:visited:active { +.indexterm:visited:hover, .indexterm:visited:focus, .indexterm:visited:active, +.qanda-toc a:hover, .qanda-toc a:focus, .qanda-toc a:active, +.qanda-toc a:visited:hover, .qanda-toc a:visited:focus, .qanda-toc a:visited:active { color: #439539; text-decoration: underline; } @@ -1522,7 +1531,8 @@ .procedure-title .xref:hover, .procedure-title .xref:focus, .procedure-title .xref:active, .orderedlist-title .xref:hover, .orderedlist-title .xref:focus, .orderedlist-title .xref:active, .itemizedlist-title .xref:hover, .itemizedlist-title .xref:focus, .itemizedlist-title .xref:active, -.variablelist-title .xref:hover, .variablelist-title .xref:focus, .variablelist-title .xref:active { +.variablelist-title .xref:hover, .variablelist-title .xref:focus, .variablelist-title .xref:active, +.qandadiv-title .xref:hover, .qandadiv-title .xref:focus, .qandadiv-title .xref:active { color: #439539; text-decoration: none; } @@ -1667,8 +1677,8 @@ } -.variablelist dd, .glossary dd, .toc dd, -.indexdiv dd { +.variablelist dd, .glossary dd, .toc dd, .qanda-toc dd, +.indexdiv dd, .answer { margin: 0 0 17px 0; padding: 0 0 0 30px; } @@ -1778,10 +1788,10 @@ a:hover .keycap, a:focus .keycap, a:active .keycap, a:hover .command, a:focus .command, a:active .command, a:hover code, a:focus code, a:active code { - background-color: #f7faf6; border-color: #439539; } + /* We put an ndash character between keycaps that are part of an accelerator */ .key-connector { margin: 0 -1px; @@ -1790,7 +1800,7 @@ .procedure-title, .table-title, .example-title, .figure-title, .orderedlist-title, .variablelist-title, -.itemizedlist-title { +.itemizedlist-title, .qandadiv-title { font-size: 14px; font-weight: normal; text-transform: uppercase; @@ -1799,19 +1809,19 @@ } .table-title, .example-title, .procedure-title, -.variablelist-title, #_content.itemizedlist-title { +.variablelist-title, .itemizedlist-title, .qandadiv-title, .qandaentry { position: relative; top: -33px; padding-top: 33px; z-index: 1; } -.example-title, .procedure-title, .orderedlist-title { +.example-title, .procedure-title, .orderedlist-title, .qandadiv-title { margin: 24px 0 -33px; } .itemizedlist-title { - margin: 24px 0 -10px; + margin: 24px 0 -41px; } .table-title { @@ -1819,9 +1829,20 @@ } .variablelist-title { - margin: 24px 0 -53px; + margin: 24px 0 -50px; } +.qandaentry { + margin: -33px 0 22px; +} + +.qanda-toc + .qandaentry { + padding-top: 53px; +} + +.qandaentry:last-child { + margin: -33px 0 -23px; +} .procedure-title code, .procedure-title .command, .procedure-title .keycap, .table-title code, .table-title .command, .table-title .keycap, @@ -1945,6 +1966,23 @@ list-style-type: disc; } +.qanda-toc { + margin-bottom: 45px; +} + +.qandadiv { + margin: 0 0 40px 0; + border-bottom: 1px solid #efeff0; +} + +.qandadiv:last-child { + border-bottom: none; +} + +.answer .table-title, .answer .screen-wrap, .answer .variablelist { + margin-top: 10px; +} + li p { font-weight: normal; } @@ -1957,6 +1995,22 @@ margin: 0 0 24px; } +.question p { + font-size: 20px; + font-style: italic; + color: #666; +} + +.blockquote p { + font-style: italic; + color: #333; +} + +div.blockquote { + margin: 17px 35px; +} + + /* Review features */ .remark, .doc-status { Files old/suse-xsl-stylesheets/xslt_suse2/static/images/dots-darkgray.png and new/suse-xsl-stylesheets/xslt_suse2/static/images/dots-darkgray.png differ Files old/suse-xsl-stylesheets/xslt_suse2/static/images/dots-yellow.png and new/suse-xsl-stylesheets/xslt_suse2/static/images/dots-yellow.png differ Files old/suse-xsl-stylesheets/xslt_suse2/static/images/draft.png and new/suse-xsl-stylesheets/xslt_suse2/static/images/draft.png differ Files old/suse-xsl-stylesheets/xslt_suse2/static/images/icons.png and new/suse-xsl-stylesheets/xslt_suse2/static/images/icons.png differ Files old/suse-xsl-stylesheets/xslt_suse2/static/images/tick.png and new/suse-xsl-stylesheets/xslt_suse2/static/images/tick.png differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/suse-xsl-stylesheets/xslt_suse2/static/js/susebooks.js new/suse-xsl-stylesheets/xslt_suse2/static/js/susebooks.js --- old/suse-xsl-stylesheets/xslt_suse2/static/js/susebooks.js 2012-12-20 19:14:47.000000000 +0100 +++ new/suse-xsl-stylesheets/xslt_suse2/static/js/susebooks.js 2013-01-15 11:46:25.000000000 +0100 @@ -73,7 +73,7 @@ window.addEventListener('scroll', scrollDeactivator, false); } - $('#_share-print').show; + $('#_share-print').show(); if (location.protocol.match(/^(http|spdy)/)) { $('body').removeClass('offline'); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/suse-xsl-stylesheets/xslt_suse2/xhtml/chunk-common.xsl new/suse-xsl-stylesheets/xslt_suse2/xhtml/chunk-common.xsl --- old/suse-xsl-stylesheets/xslt_suse2/xhtml/chunk-common.xsl 2013-01-03 15:50:05.000000000 +0100 +++ new/suse-xsl-stylesheets/xslt_suse2/xhtml/chunk-common.xsl 2013-01-09 10:17:32.000000000 +0100 @@ -94,7 +94,7 @@ <!-- This works for all common cases, but will do foolish things when you build a $rootid that is nested more than one level deep within the root element and that $rootid is not an article. Sorry for the pain. --> - <xsl:when test="$rootid != '' and not(ancestor::*)"/> + <xsl:when test="$rootid != '' and not(ancestor::*) and self::*[@id != string($rootid)]"/> <xsl:when test="not(ancestor::*) or self::*[@id = string($rootid)]"> <xsl:apply-templates select="." mode="breadcrumbs"> <xsl:with-param name="class">book-link</xsl:with-param> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/suse-xsl-stylesheets/xslt_suse2/xhtml/docbook.xsl new/suse-xsl-stylesheets/xslt_suse2/xhtml/docbook.xsl --- old/suse-xsl-stylesheets/xslt_suse2/xhtml/docbook.xsl 2013-01-07 14:28:44.000000000 +0100 +++ new/suse-xsl-stylesheets/xslt_suse2/xhtml/docbook.xsl 2013-01-14 09:30:42.000000000 +0100 @@ -17,8 +17,9 @@ * http://doccookbook.sf.net/html/en/dbc.common.dbcustomize.html * http://sagehill.net/docbookxsl/CustomMethods.html#WriteCustomization - Author: Thomas Schraitle <t...@opensuse.org> - Copyright: 2012, Thomas Schraitle + Authors: Thomas Schraitle <t...@opensuse.org>, + Stefan Knorr <skn...@suse.de> + Copyright: 2012, 2013, Thomas Schraitle, Stefan Knorr --> @@ -51,6 +52,7 @@ <xsl:include href="html.xsl"/> <xsl:include href="admon.xsl"/> <xsl:include href="block.xsl"/> + <xsl:include href="qandaset.xsl"/> <xsl:include href="titlepage.xsl"/> <xsl:include href="titlepage.templates.xsl"/> @@ -177,9 +179,7 @@ </xsl:call-template> </xsl:attribute> <xsl:attribute name="accesskey"> - <xsl:call-template name="href.target"/> - <!-- FIXME --> - <!--<xsl:text>c</xsl:text>--> + <xsl:text>c</xsl:text> </xsl:attribute> <span class="book2-icon"> </span> <xsl:if test="$context = 'fixed-header'"> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/suse-xsl-stylesheets/xslt_suse2/xhtml/lists.xsl new/suse-xsl-stylesheets/xslt_suse2/xhtml/lists.xsl --- old/suse-xsl-stylesheets/xslt_suse2/xhtml/lists.xsl 2012-11-07 13:53:00.000000000 +0100 +++ new/suse-xsl-stylesheets/xslt_suse2/xhtml/lists.xsl 2013-01-09 14:52:38.000000000 +0100 @@ -4,6 +4,7 @@ Add a wrapper div around procedures, so the title can be left-aligned while everything else in the procedure gets a little border on the left and thus is padded a bit more. + Also make sure, variablelist entries can be linked to. Author(s): Thomas Schraitle <t...@opensuse.org>, Stefan Knorr <skn...@suse.de> Copyright: 2012, Thomas Schraitle, Stefan Knorr @@ -16,6 +17,18 @@ exclude-result-prefixes="exsl"> +<xsl:template match="varlistentry"> + <dt> + <xsl:call-template name="id.attribute"> + <xsl:with-param name="force" select="1"/> + </xsl:call-template> + <xsl:apply-templates select="term"/> + </dt> + <dd> + <xsl:apply-templates select="listitem"/> + </dd> +</xsl:template> + <xsl:template match="procedure"> <!-- Preserve order of PIs and comments --> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/suse-xsl-stylesheets/xslt_suse2/xhtml/param.xsl new/suse-xsl-stylesheets/xslt_suse2/xhtml/param.xsl --- old/suse-xsl-stylesheets/xslt_suse2/xhtml/param.xsl 2012-12-18 19:30:15.000000000 +0100 +++ new/suse-xsl-stylesheets/xslt_suse2/xhtml/param.xsl 2013-01-09 18:36:06.000000000 +0100 @@ -43,7 +43,6 @@ chapter toc,title part toc,title preface toc,title -qandadiv toc qandaset toc reference toc,title sect1 toc @@ -82,6 +81,8 @@ <!-- 11. Tables ================================================= --> <!-- 12. QAndASet =============================================== --> +<xsl:param name="qanda.defaultlabel">none</xsl:param> +<xsl:param name="qandadiv.autolabel" select="0"></xsl:param> <!-- 13. Linking ================================================ --> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/suse-xsl-stylesheets/xslt_suse2/xhtml/qandaset.xsl new/suse-xsl-stylesheets/xslt_suse2/xhtml/qandaset.xsl --- old/suse-xsl-stylesheets/xslt_suse2/xhtml/qandaset.xsl 1970-01-01 01:00:00.000000000 +0100 +++ new/suse-xsl-stylesheets/xslt_suse2/xhtml/qandaset.xsl 2013-01-15 11:42:01.000000000 +0100 @@ -0,0 +1,249 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + Purpose: + Rework the structure of Q and A sections to include fewer tables. + + Author: Stefan Knorr <skn...@suse.de> + Copyright: 2012, Stefan Knorr +--> + +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:exsl="http://exslt.org/common" + xmlns="http://www.w3.org/1999/xhtml" + exclude-result-prefixes="exsl"> + + +<xsl:template match="qandaset"> + <xsl:variable name="title" select="(blockinfo/title|info/title|title)[1]"/> + <xsl:variable name="preamble" select="*[local-name(.) != 'title' + and local-name(.) != 'titleabbrev' + and local-name(.) != 'qandadiv' + and local-name(.) != 'qandaentry']"/> + <xsl:variable name="toc"> + <xsl:call-template name="pi.dbhtml_toc"/> + </xsl:variable> + + <xsl:variable name="toc.params"> + <xsl:call-template name="find.path.params"> + <xsl:with-param name="table" select="normalize-space($generate.toc)"/> + </xsl:call-template> + </xsl:variable> + + <div> + <xsl:apply-templates select="." mode="common.html.attributes"/> + <xsl:apply-templates select="$title"/> + <xsl:if test="not($title)"> + <xsl:call-template name="id.attribute"> + <xsl:with-param name="force" select="1"/> + </xsl:call-template> + </xsl:if> + <xsl:if test="((contains($toc.params, 'toc') and $toc != '0') or $toc = '1') + and not(ancestor::answer and not($qanda.nested.in.toc=0))"> + <xsl:call-template name="process.qanda.toc"/> + </xsl:if> + <xsl:apply-templates select="$preamble"/> + <xsl:call-template name="process.qandaset"/> + </div> +</xsl:template> + + +<xsl:template name="process.qandaset"> + <xsl:apply-templates select="qandaentry|qandadiv"/> +</xsl:template> + + +<xsl:template match="qandadiv"> + <xsl:variable name="preamble" select="*[local-name(.) != 'title' + and local-name(.) != 'titleabbrev' + and local-name(.) != 'qandadiv' + and local-name(.) != 'qandaentry']"/> + + <xsl:if test="blockinfo/title|info/title|title"> + <div class="qandadiv-title-wrap"> + <xsl:apply-templates select="(blockinfo/title|info/title|title)[1]"/> + </div> + </xsl:if> + + <xsl:variable name="toc"> + <xsl:call-template name="pi.dbhtml_toc"/> + </xsl:variable> + + <xsl:variable name="toc.params"> + <xsl:call-template name="find.path.params"> + <xsl:with-param name="table" select="normalize-space($generate.toc)"/> + </xsl:call-template> + </xsl:variable> + + <xsl:if test="(contains($toc.params, 'toc') and $toc != '0') or $toc = '1'"> + <div class="toc"> + <xsl:call-template name="process.qanda.toc"/> + </div> + </xsl:if> + <xsl:if test="$preamble"> + <div class="toc"> + <xsl:apply-templates select="$preamble"/> + </div> + </xsl:if> + <div class="qandadiv"> + <xsl:apply-templates select="qandadiv|qandaentry"/> + </div> +</xsl:template> + + +<xsl:template match="qandaentry"> + <dl class="qandaentry"> + <xsl:call-template name="id.attribute"> + <xsl:with-param name="force" select="1"/> + </xsl:call-template> + + <xsl:apply-templates/> + </dl> +</xsl:template> + +<xsl:template match="question"> + <dt class="question"> + <xsl:call-template name="id.attribute"> + <xsl:with-param name="force" select="1"/> + </xsl:call-template> + <xsl:apply-templates select="*[local-name(.) != 'label']"/> + </dt> +</xsl:template> + + +<xsl:template match="answer"> + <dd class="answer"> + <xsl:call-template name="id.attribute"> + <xsl:with-param name="force" select="1"/> + </xsl:call-template> + <xsl:apply-templates select="*[local-name(.) != 'label' and local-name(.) != 'qandaentry']"/> + </dd> +</xsl:template> + +<!-- ======================================================================= --> + +<xsl:template match="qandaset/blockinfo/title| + qandaset/info/title| + qandaset/title"> + <xsl:variable name="qalevel"> + <xsl:call-template name="qanda.section.level"/> + </xsl:variable> + <xsl:element name="h{string(number($qalevel)+1)}" namespace="http://www.w3.org/1999/xhtml"> + <xsl:call-template name="id.attribute"> + <xsl:with-param name="force" select="1"/> + </xsl:call-template> + <xsl:apply-templates select="." mode="class.attribute"/> + <xsl:apply-templates/> + </xsl:element> +</xsl:template> + +<xsl:template match="qandadiv/blockinfo/title| + qandadiv/info/title| + qandadiv/title"> + <xsl:variable name="qalevel"> + <xsl:call-template name="qandadiv.section.level"/> + </xsl:variable> + + <xsl:element name="h{string(number($qalevel)+1)}" namespace="http://www.w3.org/1999/xhtml"> + <xsl:attribute name="class">qandadiv-title</xsl:attribute> + <xsl:call-template name="id.attribute"> + <xsl:with-param name="node" select=".."/> + <xsl:with-param name="force" select="1"/> + </xsl:call-template> + <xsl:apply-templates select="parent::qandadiv" mode="label.markup"/> + <xsl:if test="$qandadiv.autolabel != 0"> + <xsl:apply-templates select="." mode="intralabel.punctuation"/> + <xsl:text> </xsl:text> + </xsl:if> + <xsl:apply-templates/> + </xsl:element> +</xsl:template> + +<!-- ======================================================================= --> + +<xsl:template name="process.qanda.toc"> + <ul> + <xsl:if test="local-name(.) = 'qandaset'"> + <xsl:attribute name="class">qanda-toc</xsl:attribute> + </xsl:if> + <xsl:apply-templates select="qandadiv" mode="qandatoc.mode"/> + <xsl:apply-templates select="qandaset|qandaentry" mode="qandatoc.mode"/> + </ul> +</xsl:template> + +<xsl:template match="qandadiv" mode="qandatoc.mode"> + <li><xsl:apply-templates select="title" mode="qandatoc.mode"/> + <xsl:call-template name="process.qanda.toc"/> + </li> +</xsl:template> + +<xsl:template match="question" mode="qandatoc.mode"> + <xsl:variable name="firstch"> + <!-- Use a titleabbrev or title if available --> + <xsl:choose> + <xsl:when test="../blockinfo/titleabbrev"> + <xsl:apply-templates select="../blockinfo/titleabbrev[1]/node()"/> + </xsl:when> + <xsl:when test="../blockinfo/title"> + <xsl:apply-templates select="../blockinfo/title[1]/node()"/> + </xsl:when> + <xsl:when test="../info/titleabbrev"> + <xsl:apply-templates select="../info/titleabbrev[1]/node()"/> + </xsl:when> + <xsl:when test="../titleabbrev"> + <xsl:apply-templates select="../titleabbrev[1]/node()"/> + </xsl:when> + <xsl:when test="../info/title"> + <xsl:apply-templates select="../info/title[1]/node()"/> + </xsl:when> + <xsl:when test="../title"> + <xsl:apply-templates select="../title[1]/node()"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="(*[local-name(.)!='label'])[1]/node()"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="deflabel"> + <xsl:choose> + <xsl:when test="ancestor-or-self::*[@defaultlabel]"> + <xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()] /@defaultlabel"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$qanda.defaultlabel"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <li> + <xsl:apply-templates select="." mode="label.markup"/> + <xsl:if test="contains($deflabel,'number') and not(label)"> + <xsl:apply-templates select="." mode="intralabel.punctuation"/> + </xsl:if> + <xsl:text> </xsl:text> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select=".."/> + </xsl:call-template> + </xsl:attribute> + <xsl:value-of select="$firstch"/> + </a> + <!-- * include nested qandaset/qandaentry in TOC if user wants it --> + <xsl:if test="not($qanda.nested.in.toc = 0)"> + <xsl:apply-templates select="following-sibling::answer" mode="qandatoc.mode"/> + </xsl:if> + </li> +</xsl:template> + +<xsl:template match="answer" mode="qandatoc.mode"> + <xsl:if test="descendant::question"> + <ul> + <li> + <xsl:call-template name="process.qanda.toc"/> + </li> + </ul> + </xsl:if> +</xsl:template> + +</xsl:stylesheet> -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org