diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2001-02-24 17:21:58 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2001-02-24 17:21:58 +0000 |
commit | 2dd3ac6cc5ad82c0435e293f091faab4638158ef (patch) | |
tree | 14b2ead479f3dee1dbc420709bc22884e054c13d /tests/docbook | |
parent | 294ccb6850f153440bdfc5c8936d9871f6f0a123 (diff) | |
download | libxslt-2dd3ac6cc5ad82c0435e293f091faab4638158ef.tar.gz libxslt-2dd3ac6cc5ad82c0435e293f091faab4638158ef.tar.bz2 libxslt-2dd3ac6cc5ad82c0435e293f091faab4638158ef.zip |
Oops seems I forgot to commit the stylesheets themselves ... Daniel
Diffstat (limited to 'tests/docbook')
41 files changed, 14788 insertions, 1 deletions
diff --git a/tests/docbook/Makefile.am b/tests/docbook/Makefile.am index 195f3d25..bc9f0c34 100644 --- a/tests/docbook/Makefile.am +++ b/tests/docbook/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS = common dtd lib result test +SUBDIRS = common html dtd lib result test all: # Avoid doing the test in normal pass diff --git a/tests/docbook/html/ChangeLog b/tests/docbook/html/ChangeLog new file mode 100644 index 00000000..f43e3b5d --- /dev/null +++ b/tests/docbook/html/ChangeLog @@ -0,0 +1,259 @@ +2001-01-30 Norman Walsh <ndw@nwalsh.com> + + * autotoc.xsl: Added support for section TOCs and refentrys in components + + * index.xsl: Proper support for grouping symbol entries in the index. Thanks again Jeni. + + * lists.xsl: Added summary attribute to simplelist tables + + * param.xsl, sections.xsl: Added support for section TOCs + +2001-01-28 Norman Walsh <ndw@nwalsh.com> + + * autotoc.xsl, index.xsl: Support automatic indexing + + * biblio.xsl: Support shortaffil and jobtitle in bibliomixed + + * component.xsl: Allow anchors in component titles + + * division.xsl: Support ToCs and PartIntros in References + + * graphics.xsl: Process mediaobjectco and imageobjectco (just do the graphic, ignore the callouts) + + * inline.xsl: Fix precedence bug processing of function params + + * param.xsl: Added generate.reference.toc and generate.index + + * refentry.xsl: Handle Reference ToC correctly + + * sections.xsl: Allow anchors in section titles + + * synop.xsl, verbatim.xsl: Handle synopsis as a proper verbatim environment + +2001-01-12 Norman Walsh <ndw@nwalsh.com> + + * admon.xsl, param.xsl: Added admon.graphics.extension parameter + + * docbook.xsl: (Attempt) to fix bug with root node context + + * footnote.xsl: Improve handling of footnote links + + * keywords.xsl: Make a single META header with a comma-delimited list of keywords, instead of a set of META headers + + * table.xsl: Add anchors for ROW and ENTRY IDs + +2001-01-07 Norman Walsh <ndw@nwalsh.com> + + * component.xsl, division.xsl, titlepage.templates.xml, titlepage.xsl: + Updated to use new parameters and new titlepage formatting + + * param.xsl: Added new parameters for controlling TOCs + + * titlepage.templates.xsl: Updated + + * xref.xsl: Added support for xref to author + +2000-12-14 Norman Walsh <ndw@nwalsh.com> + + * param.xsl: Added information about parameter types (for a future web-based customization tool); added new table parameters for Saxon tablecolumn extensions + + * table.xsl: Added support for the Saxon (6-only) table column extension + +2000-11-29 Norman Walsh <ndw@nwalsh.com> + + * admon.xsl: Use PNGs for admonition graphics + + * block.xsl: Hack for putting anchors in list items + + * callout.xsl, graphics.xsl, verbatim.xsl: Updated to use Saxon 6 extensions + + * docbook.xsl: Whitespace changes + + * lists.xsl: Hack to fix anchors in list items + + * param.xsl: Added stylesheet.result.type for the Saxon extensions + + * pi.xsl: Only output the dbhtml PI if we're using.chunker + + * sections.xsl: Remove IDs from divs; we also generate anchors and it's wrong to generate both with the same ID value + + * table.xsl: Improve calculation of starting column number + + * table.xsl: Support align on tgroup + + * xref.xsl: Support bibliomixed + +2000-11-17 Norman Walsh <ndw@nwalsh.com> + + * block.xsl: Added template for highlights + + * callout.xsl, lists.xsl: Callout list marks didn't work + + * docbook.xsl: Fixed bug in calculation of root element + + * pi.xsl, xref.xsl: Reworked processing of xrefs: now a mode instead of named templates + +2000-11-15 Norman Walsh <ndw@nwalsh.com> + + * callout.xsl, graphics.xsl, param.xsl, verbatim.xsl: Saxon extension support for callouts and numbered verbatim environments + +2000-11-13 Norman Walsh <ndw@nwalsh.com> + + * param.xsl: Whitespace/documentation fixes + +2000-11-12 Norman Walsh <ndw@nwalsh.com> + + * callout.xsl, lists.xsl: Added support for callout graphics and callout-tables hack + + * chunk-common.xsl: Move write.chunk out of common; support rootid + + * chunk.xsl: Move write.chunk into chunk.xsl + + * docbook.xsl: Support rootid + + * param.xsl: Added rootid and callout graphics parameters + + * refentry.xsl: Don't wrap name anchor around refentry title + + * xref.xsl: Use local-name() instead of name(), support xref to co + + * xtchunk.xsl: Add support for method and encoding parameters to write.chunk + +2000-11-09 Norman Walsh <ndw@nwalsh.com> + + * chunk-common.xsl, chunk.xsl, xtchunk.xsl: Reworked chunking to support XT, Xalan, and Saxon + + * param.xsl: Added ulink.target parameter + + * xref.xsl: Support ulink.target + +2000-11-05 Norman Walsh <ndw@nwalsh.com> + + * chunk.xsl: Made base.dir absolute.base.dir; added encoding to saxon:output + +2000-11-03 Norman Walsh <ndw@nwalsh.com> + + * chunk.xsl: Fix suppress.navigation problems + + * chunk.xsl: Abstract chunk writing to a write.chunk template + + * sections.xsl: Parameterize wrappers around the parts of a title.ref + +2000-10-30 Norman Walsh <ndw@nwalsh.com> + + * chunk.xsl: Fix typos in suppress.navigation + +2000-10-29 Norman Walsh <ndw@nwalsh.com> + + * autotoc.xsl, division.xsl: Support ToC (for navigation) in Set title pages + + * component.xsl: Don't process footnotes in article apendixes, let the article handle them + + * footnote.xsl: Superscript the footnote numbers; make space after the hr + + * lists.xsl: Cycle numeration of nested ordered lists: 1, a, i, A, I, 1, a, ... + + * sections.xsl: Add template for subtitles + + * table.xsl: Reworked colnum calculations to handle some cases where leading entrys are missing in a row; support 'summary' attributes on HTML tables + + * titlepage.xsl: If there are no authorinitials; just make revhistorys two columns + +2000-10-26 Norman Walsh <ndw@nwalsh.com> + + * autotoc.xsl: Revised autotoc support; make the HTML valid + + * block.xsl: Added some missing IDs; added summary attribute to tables + + * changebars.xsl: More tweaks; still largely unfinished + + * chunk.xsl, param.xsl: Added suppress.navigation parameter to suppress header and footer navigation tables + + * docbook.xsl: Use ISO Latin 1 for output encoding; changed text-node to a 0/1 variable + + * graphics.xsl: Fix typos and XLink attribute values + + * html.xsl: Support trade, service, and registered dingbats + + * html.xsl: Turn off <dingbat> nonsense + + * inline.xsl: Don't put <b>'s inside titles that are likely to already be <b>; support trade, service, and registered dingbats + + * pi.xsl: Remove needless './' + + * sections.xsl: Fix header construction; check css.decoration parameter; don't output <b>'s around normal section titles + + * table.xsl: Support 'table-summary' attribute of dbhtml PI inside of tgroup to set the HTML table summary + + * titlepage.xsl: Added summary attribute to revision history table + + * verbatim.xsl: Figured out how to do non-PRE verbatim display for address and literallayout + + * xref.xsl: Fixed messages for bad xrefs + +2000-10-20 Norman Walsh <ndw@nwalsh.com> + + * Makefile: Use titlepage.xsl to generate title pages + + * titlepage.templates.xsl: Regenerated with new stylesheets + +2000-10-19 Norman Walsh <ndw@nwalsh.com> + + * Makefile, component.xsl, sections.xsl, titlepage.templates.xml, titlepage.templates.xsl: + Updates to template-driven title pages + + * ebnf.xsl, param.xsl: Documentation changes + +2000-10-17 Norman Walsh <ndw@nwalsh.com> + + * Makefile: New file. + + * ebnf.xsl, param.xsl: Updated documentation + + * param.xsl: Whitespace + + * refentry.xsl: Support referenceinfo; put reference partintro before TOC + + * titlepage.xsl: Improved formatting of legal notices + +2000-10-16 Norman Walsh <ndw@nwalsh.com> + + * chunk.xsl: Fixed prev/next calculations for chapters with multiple sections + + * ebnf.xsl, param.xsl: Added doc:reference + +2000-10-14 Norman Walsh <ndw@nwalsh.com> + + * block.xsl, glossary.xsl, lists.xsl, synop.xsl: Added priority to avoid template conflicts + + * chunk.xsl, docbook.xsl: Added user.header.content and user.footer.content + + * graphics.xsl: Rewrote support for graphics + + * inline.xsl: Added support for role='bold' on emphasis + + * titlepage.xsl: Added support for revisionflag on article titles + +2000-10-12 Norman Walsh <ndw@nwalsh.com> + + * autotoc.xsl: Don't point to empty indexes + + * changebars.xsl, lists.xsl, param.xsl: The beginnings of support for changebars + + * chunk.xsl: Added base.dir parameter; fixed typo in table cells (widht instead of width attr) + + * graphics.xsl: In media objects, always pick the first object if there's only one + +2000-10-09 Norman Walsh <ndw@nwalsh.com> + + * LostLog, admon.xsl, autotoc.xsl, biblio.xsl, block.xsl, callout.xsl, chunk.xsl, component.xsl, division.xsl, docbook.xsl, ebnf.xsl, footnote.xsl, formal.xsl, glossary.xsl, graphics.xsl, html.xsl, index.xsl, info.xsl, inline.xsl, keywords.xsl, lists.xsl, math.xsl, param.xsl, pi.xsl, qandaset.xsl, refentry.xsl, sections.xsl, synop.xsl, table.xsl, titlepage.templates.xml, titlepage.templates.xsl, titlepage.xsl, toc.xsl, verbatim.xsl, xref.xsl, xtchunk.xsl: + New file. + + * biblio.xsl: Support xref to bibliography entries + + * chunk.xsl, docbook.xsl: Turn off indenting + + * lists.xsl: Add priority to avoid specificity errors + + * xref.xsl: Support xref to bibliography entries; fix broken test for empty ulink + diff --git a/tests/docbook/html/LostLog b/tests/docbook/html/LostLog new file mode 100644 index 00000000..e66ffca5 --- /dev/null +++ b/tests/docbook/html/LostLog @@ -0,0 +1,494 @@ +2000-08-29 Norman Walsh <ndw@nwalsh.com> + + * docbook.xsl: Support html.base parameter + + * param.xsl: Made parameters into xsl:params instead of xsl:variables + +2000-08-08 Norman Walsh <ndw@nwalsh.com> + + * lists.xsl: Support numeration on orderedlists, mark and override with CSS + + * param.xsl: Added css.decoration parameter + + * xref.xsl: Support new ulink semantics; an empty ulink prints the URL as its content + +2000-07-21 Norman Walsh <ndw@nwalsh.com> + + * biblio.xsl: Support bibliographyinfo; improve handling of copyright holders + + * block.xsl: Support attribution on blockquote + + * chunk.xsl: Add root.filename parameter to rename 'index.html' + + * ebnf.xsl, param.xsl: Add exclude-result-prefixes for the doc: namespace + + * footnote.xsl: Improve formatting of footnote numbers + + * inline.xsl: Support IDs on inlines; fix priority problem on parameter + + * qandaset.xsl: Keep revhistory out of qandaset tocs + + * table.xsl: Support tfoot + + * titlepage.templates.xml, titlepage.templates.xsl: Output legalnotice on titlepages + + * xref.xsl: Support IDs on links + +2000-06-25 Norman Walsh <ndw@nwalsh.com> + + * chunk.xsl, docbook.xsl: Use attribute set for body attributes + + * graphics.xsl: Start adding support for graphic extensions + + * param.xsl: Add body.attrs and move qanda params into here + + * qandaset.xsl: Moved qanda params into param.xsl; changed to 0/1 for command-line setting + + * xref.xsl: Support xref to Q and A + +2000-05-21 Norman Walsh <ndw@nwalsh.com> + + * block.xsl: Handle sidebar titles more flexibly + + * chunk.xsl, xtchunk.xsl: Support chunking with xalan (sortof) and saxon in addition to xt + + * formal.xsl: Improve spacing around formal and informal objects + + * info.xsl: Handle jobtitle, orgname, and orgdiv in other contexts + + * param.xsl: Added spacing.paras + +2000-05-07 Norman Walsh <ndw@nwalsh.com> + + * xtchunk.xsl: Strip dbhtml PIs from the HTML output after chunking + +2000-04-19 Norman Walsh <ndw@nwalsh.com> + + * ebnf.xsl: More hacking + + * glossary.xsl: Glossary title formatting made to conform to the model of other titles + + * lists.xsl: Added ids to listitems; fixed simplelist formatting + + * xref.xsl: Some templates moved to common; support endterm + +2000-04-06 Norman Walsh <ndw@nwalsh.com> + + * ebnf.xsl: New file. + + * inline.xsl: Support new class values on sgmltag + + * lists.xsl: Support titles on ordered and itemized lists + + * synop.xsl: Support classsynopsis + + * xref.xsl: Added xpointer.idref, check.idref.targets, and check.id.unique + +2000-04-03 Norman Walsh <ndw@nwalsh.com> + + * lists.xsl: Fixed bug in tabular simplelist presentation + + * xref.xsl: Fixed message typo + +2000-03-23 Norman Walsh <ndw@nwalsh.com> + + * admon.xsl, autotoc.xsl, html.xsl, inline.xsl, lists.xsl, param.xsl, refentry.xsl, synop.xsl: + Change boolean stylesheet variables to use 0/1 instead of true()/false() to avoid representation issues when setting them from the command line + + * inline.xsl: Improve formatting of functions + + * param.xsl: Tweaked documentation; added (unused) use.id.function parameter + + * xref.xsl: Switch to using id() for cross refs + + * xtchunk.xsl: Fix error in test for parent of refentry + +2000-02-25 Norman Walsh <ndw@nwalsh.com> + + * biblio.xsl: Crude support for missing elements + + * component.xsl, glossary.xsl: Support for new *info elements + + * inline.xsl: Added exceptionname, interfacename, methodname, and remark + + * param.xsl: Added check.idref + + * xref.xsl: Added support for check.idref and href.target + +2000-02-18 Norman Walsh <ndw@nwalsh.com> + + * admon.xsl, biblio.xsl, block.xsl, callout.xsl, component.xsl, division.xsl, docbook.xsl, footnote.xsl, formal.xsl, glossary.xsl, graphics.xsl, html.xsl, index.xsl, info.xsl, inline.xsl, keywords.xsl, lists.xsl, math.xsl, param.xsl, pi.xsl, qandaset.xsl, refentry.xsl, sections.xsl, synop.xsl, table.xsl, titlepage.xsl, toc.xsl, verbatim.xsl, xref.xsl: + Removed default xmlns for HTML; it didn't work the way I thought and caused problems with Xalan + + * autotoc.xsl: Support changing the TOC list type + + * docbook.xsl: Added user.head.content hook for adding additional HEAD tags + + * inline.xsl: Made systemitem monospaced + + * param.xsl: Added toc.list.type + +2000-02-16 Norman Walsh <ndw@nwalsh.com> + + * graphics.xsl: Improved support for mediaobject and inlinemediaobject + + * lists.xsl: Handle title on step in procedure + + * param.xsl: Added graphic.default.extension + + * table.xsl: Changed the calculation of empty cells. + + * titlepage.templates.xsl: Added version attribute + + * xref.xsl: Fixed typo + +2000-02-07 Norman Walsh <ndw@nwalsh.com> + + * inline.xsl: Fixed bug in email formatting in verbatim environments + + * lists.xsl: Added (broken) support for orderedlist continuation + + * table.xsl: Fixed calculation of empty cells + + * titlepage.templates.xsl: Regenerated to workaround attr name bug + + * xref.xsl: Xref text changes for I18N; this could be buggy + +2000-01-27 Norman Walsh <ndw@nwalsh.com> + + * block.xsl: Support titles in MsgSet elements; support SimpleMsgEntry; support RevDescription + + * docbook.xsl, titlepage.article.xsl, titlepage.book.xsl, titlepage.part.xsl, titlepage.reference.xsl, titlepage.section.xsl, titlepage.set.xsl, titlepage.templates.xml, titlepage.templates.xsl: + Completely revamped titlepage code; it's now all template based + + * lists.xsl: Support list titles + + * param.xsl: Added section.label.includes.component.lable + + * refentry.xsl: Support refentry *info meta + + * sections.xsl: Fix section DIV class names + + * titlepage.xsl: Support RevDescription + +2000-01-14 Norman Walsh <ndw@nwalsh.com> + + * docbook.xsl: Display message about unmatched tags + + * index.xsl: Don't output anything for a completely empty index + + * param.xsl: Fixed docbug + + * xtchunk.xsl: Don't output a chunk for a completely blank index + +2000-01-11 Norman Walsh <ndw@nwalsh.com> + + * component.xsl, titlepage.article.xsl: Handle ArticleInfo (DocBook 4.0 :-) + + * xtchunk.xsl: Fix bug calculating ischunk + +2000-01-10 Norman Walsh <ndw@nwalsh.com> + + * autotoc.xsl: Updated label.content (for recursion) and TOC name (for L10N) + + * block.xsl: Added AckNo + + * docbook.xsl, xref.xsl: Support anchor and olink; L10N of quotation marks + + * index.xsl: Handle SetIndex and indexing inlines + + * inline.xsl: Added constant, varname, and pob; L10N on quotation marks + + * param.xsl: Made default html.stylesheet empty; added qandadiv.autolabel and qanda.inherit.numeration + + * qandaset.xsl: New file. + + * refentry.xsl: Added ref*info + + * table.xsl: Support tfoot + + * toc.xsl: Handle lot and descendants of toc and lot + + * xref.xsl: Fixed xrefs to formal objects + +1999-12-28 Norman Walsh <ndw@nwalsh.com> + + * admon.xsl: Use admon.graphic.width + + * autotoc.xsl, block.xsl, component.xsl, formal.xsl, sections.xsl, titlepage.xsl, xref.xsl: + Updated to use new title generation code from common.xsl + + * docbook.xsl: Reorganize HTML HEAD computation for xtchunk.xsl; use new title generation code + + * html.xsl: Use Unicode chars for dingbats since we have a real serializer now + + * param.xsl: Added part.autolabel, preface.autolabel, link.mailto.url, and tweaked documentation + + * pi.xsl: Added dbhtml-attribute, dbhtml-dir, and dbhtml-filename (for xtchunk.xsl, mostly) + + * xtchunk.xsl: Finished first pass at XT-based chunker + + * xtchunk.xsl: Fixed typos; improved messages + +1999-12-24 Norman Walsh <ndw@nwalsh.com> + + * xtchunk.xsl: New file. + +1999-12-22 Norman Walsh <ndw@nwalsh.com> + + * autotoc.xsl: Created function href.target so xtchunk.xsl can override it + + * division.xsl: Add some ID attributes + + * param.xsl: More doc namespace fiddling + + * table.xsl: Try to output nbsp when cells are empty + + * xref.xsl: Output warning messages about broken IDREFs + +1999-11-23 Norman Walsh <ndw@nwalsh.com> + + * autotoc.xsl, sections.xsl: Split section label/title code, allow auto TOCs to link just the title + + * graphics.xsl: Added support for align attribute on graphics + + * table.xsl: Replace xsl:element with literal element + +1999-11-16 Norman Walsh <ndw@nwalsh.com> + + * graphics.xsl: Support fileref and entityref on external objects + +1999-11-10 Norman Walsh <ndw@nwalsh.com> + + * block.xsl: Don't put borders around revhistorys + + * docbook.xsl: Produce HTML; handle a few more root titles + +1999-11-05 Norman Walsh <ndw@nwalsh.com> + + * docbookh.xsl: Rearranged code so this isn't necessary + +1999-11-03 Norman Walsh <ndw@nwalsh.com> + + * admon.xsl, autotoc.xsl, biblio.xsl, block.xsl, callout.xsl, component.xsl, division.xsl, docbook.xsl, docbookh.xsl, footnote.xsl, formal.xsl, glossary.xsl, graphics.xsl, html.xsl, index.xsl, info.xsl, inline.xsl, keywords.xsl, lists.xsl, math.xsl, param.xsl, pi.xsl, refentry.xsl, sections.xsl, synop.xsl, table.xsl, titlepage.article.xsl, titlepage.book.xsl, titlepage.part.xsl, titlepage.reference.xsl, titlepage.section.xsl, titlepage.set.xsl, titlepage.xsl, toc.xsl, verbatim.xsl, xref.xsl: + Added default namespace and stylesheet version + + * block.xsl: Support revhistory in block contexts + +1999-11-02 Norman Walsh <ndw@nwalsh.com> + + * autotoc.xsl: Added support for generate.{division|component}.toc + + * block.xsl: Added space after formal para titles + + * callout.xsl: Rudimentary support for callouts + + * component.xsl: Support for label attribute on components + + * html.xsl: Use disable-output-escaping to produce entity refs if the chunker isn't being used + + * lists.xsl: More simplelist fixes, support for callouts + + * param.xsl: Added documentation (there's no processor for it yet) + + * refentry.xsl: Renamed refentry.function parameter to refentry.xref.manvolnum + + * sections.xsl: Support for label attributes on sections + +1999-10-28 Norman Walsh <ndw@nwalsh.com> + + * autotoc.xsl: Format RefEntrys correctly in the TOC + + * division.xsl: Make TOCs in Parts + + * docbook.xsl: Try a little harder to find the title + + * lists.xsl: Fix SimpleList formatting + + * refentry.xsl: Fix RefName formatting; add TOCs to References; process RefEntry footnotes + + * titlepage.xsl: Fix ID values on titles + +1999-10-22 Norman Walsh <ndw@nwalsh.com> + + * lists.xsl: Updated support for simplelist + +1999-10-21 Norman Walsh <ndw@nwalsh.com> + + * docbook.xsl: Add meta back to the head + + * titlepage.article.xsl: Fixed URI + +1999-10-20 Norman Walsh <ndw@nwalsh.com> + + * admon.xsl, autotoc.xsl, biblio.xsl, block.xsl, callout.xsl, component.xsl, division.xsl, docbook.xsl, footnote.xsl, formal.xsl, glossary.xsl, graphics.xsl, html.xsl, index.xsl, info.xsl, inline.xsl, keywords.xsl, lists.xsl, math.xsl, param.xsl, pi.xsl, refentry.xsl, sections.xsl, synop.xsl, table.xsl, titlepage.book.xsl, titlepage.part.xsl, titlepage.reference.xsl, titlepage.section.xsl, titlepage.set.xsl, titlepage.xsl, toc.xsl, verbatim.xsl, xref.xsl: + Update URI in all the included modules + + * docbookh.xsl: New file. + +1999-10-18 Norman Walsh <ndw@nwalsh.com> + + * docbook.xsl: Added xsl:output, fixed URI for PR + +1999-09-27 Norman Walsh <ndw@nwalsh.com> + + * autotoc.xsl: Use DL instead of UL for auto TOCs (no bullets) + +1999-09-25 Norman Walsh <ndw@nwalsh.com> + + * xref.xsl: Improved xreflabel support, support for xref to cmdsynopsis and funcsynopsis + +1999-09-24 Norman Walsh <ndw@nwalsh.com> + + * autotoc.xsl: Made TOC entries 'hot' + + * docbook.xsl: Moved PI handling to pi.xsl, use strip/preserve from common.xsl + + * formal.xsl: Tidy up some code, make sure objects have anchors + + * pi.xsl: New file. + + * synop.xsl: Make sure synopses have anchors and IDs + +1999-08-19 Norman Walsh <ndw@nwalsh.com> + + * docbook.xsl: Removed default-space attribute + + * lists.xsl: Fixed name/select bug on with-param + +1999-08-11 Norman Walsh <ndw@nwalsh.com> + + * autotoc.xsl: Support links from TOC + + * lists.xsl: Reworked buggy call-template (used to contain xsl:if) + + * sections.xsl: Support auto-label again + + * titlepage.book.xsl, titlepage.part.xsl, titlepage.reference.xsl, titlepage.set.xsl: + Removed unused named templates + +1999-07-31 Norman Walsh <ndw@nwalsh.com> + + * component.xsl: Fixed bad anchor name + +1999-07-27 Norman Walsh <ndw@nwalsh.com> + + * admon.xsl, autotoc.xsl, biblio.xsl, block.xsl, callout.xsl, component.xsl, division.xsl, docbook.xsl, footnote.xsl, formal.xsl, glossary.xsl, graphics.xsl, html.xsl, index.xsl, info.xsl, inline.xsl, lists.xsl, param.xsl, refentry.xsl, sections.xsl, synop.xsl, table.xsl, titlepage.article.xsl, titlepage.book.xsl, titlepage.part.xsl, titlepage.reference.xsl, titlepage.section.xsl, titlepage.set.xsl, titlepage.xsl, verbatim.xsl, xref.xsl: + Updated to July spec + +1999-07-18 Norman Walsh <ndw@nwalsh.com> + + * admon.xsl, inline.xsl, titlepage.xsl: Mode bugs + + * refentry.xsl: Removed bogus text + +1999-07-16 Norman Walsh <ndw@nwalsh.com> + + * lists.xsl: Fixed bug where match/name were misused + +1999-07-06 Norman Walsh <ndw@nwalsh.com> + + * component.xsl: Remodularized to support titles on components with optional titles + + * footnote.xsl, table.xsl: Handle table footnotes properly + + * refentry.xsl: Support numbering of references + + * sections.xsl: Added inline.section.title + + * xref.xsl: Remodularized to make customization of xrefs easier + +1999-07-02 Norman Walsh <ndw@nwalsh.com> + + * autotoc.xsl: Fixed bugs in toc generation; support for toc.section.depth + + * block.xsl: Make a blockquote a blockquote; support abstract outside of info blocks + + * division.xsl: Added support for numbering of Books and Parts + + * docbook.xsl: Adjust includes, dbl10n becomes l10n, add toc + + * glossary.xsl: Improvements to glossary and glosslist handling + + * graphics.xsl: Add screenshot + + * html.xsl: Test for using.chunker in dingbat output + + * inline.xsl: Support inline persons (author, editor, othercredit), fix menuchoice, support productnumber + + * lists.xsl: Allow xrefs to listitems in orderedlists, remove borders from tabular simplelists + + * param.xsl: Added using.chunker and toc.section.depth + + * refentry.xsl: Improve support for refentry page titles + + * toc.xsl: New file. + + * xref.xsl: Add support for xrefs to sections, appendixes, prefaces, books, and parts + +1999-06-14 Norman Walsh <ndw@nwalsh.com> + + * biblio.xsl: Significant improvements in bibliography support + + * docbook.xsl: Added strip/preserve space support; fixed bug in HTML title header + + * formal.xsl: Replaced an xsl:attribute element with a AVT + + * info.xsl: Changed comments; added and then removed much more substantial changes + + * keywords.xsl: New file. + + * param.xsl: Added section.autolabel and biblioentry.item.separator + + * sections.xsl: Added support for section titlepages + + * titlepage.article.xsl, titlepage.book.xsl, titlepage.part.xsl, titlepage.reference.xsl, titlepage.set.xsl, titlepage.xsl: + Reorganized titlepages; things are much simpler now and most titlepages simply inherit from titlepage.xsl + + * titlepage.section.xsl: New file. + +1999-06-09 Norman Walsh <ndw@nwalsh.com> + + * admon.xsl, autotoc.xsl, biblio.xsl, block.xsl, callout.xsl, component.xsl, division.xsl, docbook.xsl, footnote.xsl, formal.xsl, glossary.xsl, graphics.xsl, index.xsl, info.xsl, inline.xsl, lists.xsl, param.xsl, refentry.xsl, sections.xsl, synop.xsl, table.xsl, titlepage.article.xsl, titlepage.book.xsl, titlepage.part.xsl, titlepage.reference.xsl, titlepage.set.xsl, titlepage.xsl, verbatim.xsl, xref.xsl: + Changed HTML markup to lowercase; tinkered with autotoc and admonitions + +1999-06-07 Norman Walsh <ndw@nwalsh.com> + + * autotoc.xsl, component.xsl, division.xsl, docbook.xsl: + Automatic TOCs + + * sections.xsl: Section headings can't be in common + +1999-06-03 Norman Walsh <ndw@nwalsh.com> + + * biblio.xsl: New file. + + * docbook.xsl: Added result-ns; rudimentary biblio and glossary support + + * formal.xsl: Added informalfigure + + * glossary.xsl: New file. + + * graphics.xsl: Added mediaobject and inlinemediaobject + + * titlepage.article.xsl: Added revision to article titlepage + + * xref.xsl: Added support for xref to section + +1999-05-20 Norman Walsh <ndw@nwalsh.com> + + * admon.xsl, block.xsl, component.xsl, division.xsl, docbook.xsl, footnote.xsl, formal.xsl, graphics.xsl, html.xsl, index.xsl, inline.xsl, lists.xsl, math.xsl, param.xsl, refentry.xsl, sections.xsl, synop.xsl, table.xsl, titlepage.article.xsl, titlepage.book.xsl, titlepage.part.xsl, titlepage.set.xsl, verbatim.xsl, xref.xsl: + Many updates + + * block.xsl, docbook.xsl, formal.xsl, html.xsl, inline.xsl, lists.xsl, param.xsl, refentry.xsl, synop.xsl, table.xsl: + Updates + + * callout.xsl: New file. + + * titlepage.reference.xsl: New file. + +1999-05-19 Norman Walsh <ndw@nwalsh.com> + + * docbook.xsl, formal.xsl, html.xsl, info.xsl, inline.xsl, lists.xsl, param.xsl, sections.xsl, table.xsl, titlepage.article.xsl, titlepage.xsl, verbatim.xsl, xref.xsl: + New file. + diff --git a/tests/docbook/html/Makefile.am b/tests/docbook/html/Makefile.am new file mode 100644 index 00000000..24466ed7 --- /dev/null +++ b/tests/docbook/html/Makefile.am @@ -0,0 +1,12 @@ +## Process this file with automake to produce Makefile.in + +all: + +EXTRA_DIST = \ + ChangeLog LostLog admon.xsl autotoc.xsl biblio.xsl block.xsl callout.xsl \ + changebars.xsl chunk-common.xsl chunk.xsl component.xsl division.xsl \ + docbook.xsl ebnf.xsl footnote.xsl formal.xsl glossary.xsl graphics.xsl \ + html.xsl index.xsl info.xsl inline.xsl keywords.xsl lists.xsl math.xsl \ + param.xsl pi.xsl qandaset.xsl refentry.xsl sections.xsl synop.xsl \ + table.xsl titlepage.templates.xml titlepage.templates.xsl titlepage.xsl \ + toc.xsl verbatim.xsl xref.xsl xtchunk.xsl diff --git a/tests/docbook/html/admon.xsl b/tests/docbook/html/admon.xsl new file mode 100644 index 00000000..234c3a24 --- /dev/null +++ b/tests/docbook/html/admon.xsl @@ -0,0 +1,149 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<xsl:template match="note|important|warning|caution|tip"> + <xsl:choose> + <xsl:when test="$admon.graphics != 0"> + <xsl:call-template name="graphical.admonition"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="nongraphical.admonition"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="admon.graphic.width"> + <xsl:param name="node" select="."/> + <xsl:text>25</xsl:text> +</xsl:template> + +<xsl:template name="admon.graphic"> + <xsl:param name="node" select="."/> + <xsl:value-of select="$admon.graphics.path"/> + <xsl:choose> + <xsl:when test="name($node)='note'">note</xsl:when> + <xsl:when test="name($node)='warning'">warning</xsl:when> + <xsl:when test="name($node)='caution'">caution</xsl:when> + <xsl:when test="name($node)='tip'">tip</xsl:when> + <xsl:when test="name($node)='important'">important</xsl:when> + <xsl:otherwise>note</xsl:otherwise> + </xsl:choose> + <xsl:value-of select="$admon.graphics.extension"/> +</xsl:template> + +<xsl:template name="graphical.admonition"> + <div class="{name(.)}"> + <xsl:if test="$admon.style"> + <xsl:attribute name="style"> + <xsl:value-of select="$admon.style"/> + </xsl:attribute> + </xsl:if> + <table border="0"> + <tr> + <td rowspan="2" align="center" valign="top"> + <xsl:attribute name="width"> + <xsl:call-template name="admon.graphic.width"/> + </xsl:attribute> + <img> + <xsl:attribute name="src"> + <xsl:call-template name="admon.graphic"/> + </xsl:attribute> + </img> + </td> + <th> + <xsl:choose> + <xsl:when test="./title"> + <xsl:apply-templates select="./title" + mode="graphic.admonition.title.mode"/> + </xsl:when> + <xsl:otherwise> + <a> + <xsl:attribute name="name"> + <xsl:call-template name="object.id"/> + </xsl:attribute> + <xsl:call-template name="gentext.element.name"/> + </a> + </xsl:otherwise> + </xsl:choose> + </th> + </tr> + <tr> + <td colspan="2" align="left" valign="top"> + <xsl:apply-templates/> + </td> + </tr> + </table> + </div> +</xsl:template> + +<xsl:template name="nongraphical.admonition"> + <div class="{name(.)}"> + <xsl:if test="$admon.style"> + <xsl:attribute name="style"> + <xsl:value-of select="$admon.style"/> + </xsl:attribute> + </xsl:if> + <xsl:choose> + <xsl:when test="./title"> + <xsl:apply-templates select="./title" mode="admonition.title.mode"/> + </xsl:when> + <xsl:otherwise> + <h3 class="title"> + <a> + <xsl:attribute name="name"> + <xsl:call-template name="object.id"/> + </xsl:attribute> + <xsl:call-template name="gentext.element.name"/> + </a> + </h3> + </xsl:otherwise> + </xsl:choose> + + <xsl:apply-templates/> + </div> +</xsl:template> + +<xsl:template match="note/title"></xsl:template> +<xsl:template match="important/title"></xsl:template> +<xsl:template match="warning/title"></xsl:template> +<xsl:template match="caution/title"></xsl:template> +<xsl:template match="tip/title"></xsl:template> + +<xsl:template match="title" mode="admonition.title.mode"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select=".."/> + </xsl:call-template> + </xsl:variable> + <h3 class="title"> + <a name="{$id}"> + <xsl:apply-templates/> + </a> + </h3> +</xsl:template> + +<xsl:template match="title" mode="graphic.admonition.title.mode"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select=".."/> + </xsl:call-template> + </xsl:variable> + <b class="title"> + <a name="{$id}"> + <xsl:apply-templates/> + </a> + </b> +</xsl:template> + +</xsl:stylesheet> diff --git a/tests/docbook/html/autotoc.xsl b/tests/docbook/html/autotoc.xsl new file mode 100644 index 00000000..e4a2204d --- /dev/null +++ b/tests/docbook/html/autotoc.xsl @@ -0,0 +1,511 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<xsl:template name="href.target"> + <xsl:param name="object" select="."/> + <xsl:text>#</xsl:text> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select="$object"/> + </xsl:call-template> +</xsl:template> + +<xsl:variable name="toc.listitem.type"> + <xsl:choose> + <xsl:when test="$toc.list.type = 'dl'">dt</xsl:when> + <xsl:otherwise>li</xsl:otherwise> + </xsl:choose> +</xsl:variable> + +<!-- this is just hack because dl and ul aren't completely isomorphic --> +<xsl:variable name="toc.dd.type"> + <xsl:choose> + <xsl:when test="$toc.list.type = 'dl'">dd</xsl:when> + <xsl:otherwise></xsl:otherwise> + </xsl:choose> +</xsl:variable> + +<xsl:template name="set.toc"> + <xsl:variable name="nodes" select="book|setindex"/> + <xsl:if test="$nodes"> + <div class="toc"> + <p> + <b> + <xsl:call-template name="gentext.element.name"> + <xsl:with-param name="element.name">TableofContents</xsl:with-param> + </xsl:call-template> + </b> + </p> + <xsl:element name="{$toc.list.type}"> + <xsl:apply-templates select="$nodes" mode="toc"/> + </xsl:element> + </div> + </xsl:if> +</xsl:template> + +<xsl:template name="division.toc"> + <xsl:if test="$generate.division.toc != 0"> + <xsl:variable name="nodes" select="part|reference + |preface|chapter|appendix + |bibliography|glossary|index + |refentry"/> + <xsl:if test="$nodes"> + <div class="toc"> + <p> + <b> + <xsl:call-template name="gentext.element.name"> + <xsl:with-param name="element.name">TableofContents</xsl:with-param> + </xsl:call-template> + </b> + </p> + <xsl:element name="{$toc.list.type}"> + <xsl:apply-templates select="$nodes" mode="toc"/> + </xsl:element> + </div> + </xsl:if> + </xsl:if> +</xsl:template> + +<xsl:template name="component.toc"> + <xsl:if test="$generate.component.toc != 0"> + <xsl:variable name="nodes" select="section|sect1|refentry"/> + <xsl:if test="$nodes"> + <div class="toc"> + <p> + <b> + <xsl:call-template name="gentext.element.name"> + <xsl:with-param name="element.name">TableofContents</xsl:with-param> + </xsl:call-template> + </b> + </p> + <xsl:element name="{$toc.list.type}"> + <xsl:apply-templates select="$nodes" mode="toc"/> + </xsl:element> + </div> + </xsl:if> + </xsl:if> +</xsl:template> + +<xsl:template name="section.toc"> + <xsl:variable name="nodes" select="section|sect1|sect2|sect3|sect4|sect5|refentry"/> + <xsl:if test="$nodes"> + <div class="toc"> + <p> + <b> + <xsl:call-template name="gentext.element.name"> + <xsl:with-param name="element.name">TableofContents</xsl:with-param> + </xsl:call-template> + </b> + </p> + <xsl:element name="{$toc.list.type}"> + <xsl:apply-templates select="$nodes" mode="toc"/> + </xsl:element> + </div> + </xsl:if> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="book|setindex" mode="toc"> + <xsl:variable name="nodes" select="part|reference + |preface|chapter|appendix + |bibliography|glossary|index + |refentry"/> + + <xsl:variable name="subtoc"> + <xsl:element name="{$toc.list.type}"> + <xsl:apply-templates mode="toc" select="$nodes"/> + </xsl:element> + </xsl:variable> + + <xsl:variable name="subtoc.list"> + <xsl:choose> + <xsl:when test="$toc.dd.type = ''"> + <xsl:copy-of select="$subtoc"/> + </xsl:when> + <xsl:otherwise> + <xsl:element name="{$toc.dd.type}"> + <xsl:copy-of select="$subtoc"/> + </xsl:element> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:element name="{$toc.listitem.type}"> + <xsl:apply-templates select="." mode="label.content"/> + <xsl:text> </xsl:text> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"/> + </xsl:attribute> + <xsl:apply-templates select="." mode="title.content"/> + </a> + <xsl:if test="$toc.listitem.type = 'li' + and $toc.section.depth>0 and count($nodes)>0"> + <xsl:copy-of select="$subtoc.list"/> + </xsl:if> + </xsl:element> + <xsl:if test="$toc.listitem.type != 'li' + and $toc.section.depth>0 and count($nodes)>0"> + <xsl:copy-of select="$subtoc.list"/> + </xsl:if> +</xsl:template> + +<xsl:template match="part|reference|preface|chapter|appendix" + mode="toc"> + <xsl:variable name="subtoc"> + <xsl:element name="{$toc.list.type}"> + <xsl:apply-templates select="section|sect1" mode="toc"/> + </xsl:element> + </xsl:variable> + + <xsl:variable name="subtoc.list"> + <xsl:choose> + <xsl:when test="$toc.dd.type = ''"> + <xsl:copy-of select="$subtoc"/> + </xsl:when> + <xsl:otherwise> + <xsl:element name="{$toc.dd.type}"> + <xsl:copy-of select="$subtoc"/> + </xsl:element> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:element name="{$toc.listitem.type}"> + <xsl:apply-templates select="." mode="label.content"/> + <xsl:text> </xsl:text> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"/> + </xsl:attribute> + <xsl:apply-templates select="." mode="title.content"/> + </a> + <xsl:if test="$toc.listitem.type = 'li' + and $toc.section.depth>0 and section|sect1"> + <xsl:copy-of select="$subtoc.list"/> + </xsl:if> + </xsl:element> + <xsl:if test="$toc.listitem.type != 'li' + and $toc.section.depth>0 and section|sect1"> + <xsl:copy-of select="$subtoc.list"/> + </xsl:if> +</xsl:template> + +<xsl:template match="sect1" mode="toc"> + <xsl:variable name="subtoc"> + <xsl:element name="{$toc.list.type}"> + <xsl:apply-templates select="sect2" mode="toc"/> + </xsl:element> + </xsl:variable> + + <xsl:variable name="subtoc.list"> + <xsl:choose> + <xsl:when test="$toc.dd.type = ''"> + <xsl:copy-of select="$subtoc"/> + </xsl:when> + <xsl:otherwise> + <xsl:element name="{$toc.dd.type}"> + <xsl:copy-of select="$subtoc"/> + </xsl:element> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:element name="{$toc.listitem.type}"> + <xsl:apply-templates select="." mode="label.content"/> + <xsl:text> </xsl:text> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"/> + </xsl:attribute> + <xsl:apply-templates select="." mode="title.content"/> + </a> + <xsl:if test="$toc.listitem.type = 'li' + and $toc.section.depth>1 and sect2"> + <xsl:copy-of select="$subtoc.list"/> + </xsl:if> + </xsl:element> + <xsl:if test="$toc.listitem.type != 'li' + and $toc.section.depth>1 and sect2"> + <xsl:copy-of select="$subtoc.list"/> + </xsl:if> +</xsl:template> + +<xsl:template match="sect2" mode="toc"> + <xsl:variable name="subtoc"> + <xsl:element name="{$toc.list.type}"> + <xsl:apply-templates select="sect3" mode="toc"/> + </xsl:element> + </xsl:variable> + + <xsl:variable name="subtoc.list"> + <xsl:choose> + <xsl:when test="$toc.dd.type = ''"> + <xsl:copy-of select="$subtoc"/> + </xsl:when> + <xsl:otherwise> + <xsl:element name="{$toc.dd.type}"> + <xsl:copy-of select="$subtoc"/> + </xsl:element> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:element name="{$toc.listitem.type}"> + <xsl:apply-templates select="." mode="label.content"/> + <xsl:text> </xsl:text> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"/> + </xsl:attribute> + <xsl:apply-templates select="." mode="title.content"/> + </a> + <xsl:if test="$toc.listitem.type = 'li' + and $toc.section.depth>2 and sect3"> + <xsl:copy-of select="$subtoc.list"/> + </xsl:if> + </xsl:element> + <xsl:if test="$toc.listitem.type != 'li' + and $toc.section.depth>2 and sect3"> + <xsl:copy-of select="$subtoc.list"/> + </xsl:if> +</xsl:template> + +<xsl:template match="sect3" mode="toc"> + <xsl:variable name="subtoc"> + <xsl:element name="{$toc.list.type}"> + <xsl:apply-templates select="sect4" mode="toc"/> + </xsl:element> + </xsl:variable> + + <xsl:variable name="subtoc.list"> + <xsl:choose> + <xsl:when test="$toc.dd.type = ''"> + <xsl:copy-of select="$subtoc"/> + </xsl:when> + <xsl:otherwise> + <xsl:element name="{$toc.dd.type}"> + <xsl:copy-of select="$subtoc"/> + </xsl:element> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:element name="{$toc.listitem.type}"> + <xsl:apply-templates select="." mode="label.content"/> + <xsl:text> </xsl:text> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"/> + </xsl:attribute> + <xsl:apply-templates select="." mode="title.content"/> + </a> + <xsl:if test="$toc.listitem.type = 'li' + and $toc.section.depth>3 and sect4"> + <xsl:copy-of select="$subtoc.list"/> + </xsl:if> + </xsl:element> + <xsl:if test="$toc.listitem.type != 'li' + and $toc.section.depth>3 and sect4"> + <xsl:copy-of select="$subtoc.list"/> + </xsl:if> +</xsl:template> + +<xsl:template match="sect4" mode="toc"> + <xsl:variable name="subtoc"> + <xsl:element name="{$toc.list.type}"> + <xsl:apply-templates select="sect5" mode="toc"/> + </xsl:element> + </xsl:variable> + + <xsl:variable name="subtoc.list"> + <xsl:choose> + <xsl:when test="$toc.dd.type = ''"> + <xsl:copy-of select="$subtoc"/> + </xsl:when> + <xsl:otherwise> + <xsl:element name="{$toc.dd.type}"> + <xsl:copy-of select="$subtoc"/> + </xsl:element> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:element name="{$toc.listitem.type}"> + <xsl:apply-templates select="." mode="label.content"/> + <xsl:text> </xsl:text> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"/> + </xsl:attribute> + <xsl:apply-templates select="." mode="title.content"/> + </a> + <xsl:if test="$toc.listitem.type = 'li' + and $toc.section.depth>4 and sect5"> + <xsl:copy-of select="$subtoc.list"/> + </xsl:if> + </xsl:element> + <xsl:if test="$toc.listitem.type != 'li' + and $toc.section.depth>4 and sect5"> + <xsl:copy-of select="$subtoc.list"/> + </xsl:if> +</xsl:template> + +<xsl:template match="sect5" mode="toc"> + <xsl:element name="{$toc.listitem.type}"> + <xsl:apply-templates select="." mode="label.content"/> + <xsl:text> </xsl:text> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"/> + </xsl:attribute> + <xsl:apply-templates select="." mode="title.content"/> + </a> + </xsl:element> +</xsl:template> + +<xsl:template match="section" mode="toc"> + <xsl:variable name="subtoc"> + <xsl:element name="{$toc.list.type}"> + <xsl:apply-templates select="section" mode="toc"/> + </xsl:element> + </xsl:variable> + + <xsl:variable name="subtoc.list"> + <xsl:choose> + <xsl:when test="$toc.dd.type = ''"> + <xsl:copy-of select="$subtoc"/> + </xsl:when> + <xsl:otherwise> + <xsl:element name="{$toc.dd.type}"> + <xsl:copy-of select="$subtoc"/> + </xsl:element> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="toodeep"> + <xsl:choose> + <!-- if the depth is less than 2, we're already deep enough --> + <xsl:when test="$toc.section.depth < 2">yes</xsl:when> + <!-- if the current section has n-1 section ancestors --> + <!-- then we've already reached depth n --> + <xsl:when test="ancestor::section[position()=$toc.section.depth - 1]"> + <xsl:text>yes</xsl:text> + </xsl:when> + <!-- otherwise, keep going --> + <xsl:otherwise>no</xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:element name="{$toc.listitem.type}"> + <xsl:apply-templates select="." mode="label.content"/> + <xsl:text> </xsl:text> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"/> + </xsl:attribute> + <xsl:apply-templates select="." mode="title.content"/> + </a> + <xsl:if test="$toc.listitem.type = 'li' + and $toodeep='no' and section"> + <xsl:copy-of select="$subtoc.list"/> + </xsl:if> + </xsl:element> + <xsl:if test="$toc.listitem.type != 'li' + and $toodeep='no' and section"> + <xsl:copy-of select="$subtoc.list"/> + </xsl:if> +</xsl:template> + +<xsl:template match="bibliography|glossary" + mode="toc"> + <xsl:element name="{$toc.listitem.type}"> + <xsl:choose> + <xsl:when test="title[1]"> + <xsl:apply-templates select="title[1]" mode="toc"/> + </xsl:when> + <xsl:otherwise> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"/> + </xsl:attribute> + <xsl:call-template name="gentext.element.name"/> + </a> + </xsl:otherwise> + </xsl:choose> + </xsl:element> +</xsl:template> + +<xsl:template match="index" mode="toc"> + <!-- If the index tag is empty, don't point at it from the TOC --> + <xsl:if test="* or $generate.index"> + <xsl:element name="{$toc.listitem.type}"> + <xsl:choose> + <xsl:when test="title[1]"> + <xsl:apply-templates select="title[1]" mode="toc"/> + </xsl:when> + <xsl:otherwise> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"/> + </xsl:attribute> + <xsl:call-template name="gentext.element.name"/> + </a> + </xsl:otherwise> + </xsl:choose> + </xsl:element> + </xsl:if> +</xsl:template> + +<xsl:template match="refentry" mode="toc"> + <xsl:variable name="refmeta" select=".//refmeta"/> + <xsl:variable name="refentrytitle" select="$refmeta//refentrytitle"/> + <xsl:variable name="refnamediv" select=".//refnamediv"/> + <xsl:variable name="refname" select="$refnamediv//refname"/> + <xsl:variable name="title"> + <xsl:choose> + <xsl:when test="$refentrytitle"> + <xsl:apply-templates select="$refentrytitle[1]" mode="title"/> + </xsl:when> + <xsl:when test="$refname"> + <xsl:apply-templates select="$refname[1]" mode="title"/> + </xsl:when> + <xsl:otherwise></xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:element name="{$toc.listitem.type}"> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"/> + </xsl:attribute> + <xsl:copy-of select="$title"/> + </a> + </xsl:element> +</xsl:template> + +<xsl:template match="title" mode="toc"> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select=".."/> + </xsl:call-template> + </xsl:attribute> + <xsl:apply-templates/> + </a> +</xsl:template> + +</xsl:stylesheet> + diff --git a/tests/docbook/html/biblio.xsl b/tests/docbook/html/biblio.xsl new file mode 100644 index 00000000..27420257 --- /dev/null +++ b/tests/docbook/html/biblio.xsl @@ -0,0 +1,948 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<!-- ==================================================================== --> + +<xsl:template match="bibliography"> + <div class="{name(.)}"> + <xsl:call-template name="component.separator"/> + <xsl:choose> + <xsl:when test="./title"> + <xsl:apply-templates select="./title" mode="component.title.mode"/> + </xsl:when> + <xsl:otherwise> + <h2 class="title"> + <a> + <xsl:attribute name="name"> + <xsl:call-template name="object.id"/> + </xsl:attribute> + <xsl:call-template name="gentext.element.name"/> + </a> + </h2> + </xsl:otherwise> + </xsl:choose> + + <xsl:if test="./subtitle"> + <xsl:apply-templates select="./subtitle" mode="component.title.mode"/> + </xsl:if> + + <xsl:apply-templates/> + <xsl:call-template name="process.footnotes"/> + </div> +</xsl:template> + +<xsl:template match="bibliography/bibliographyinfo"></xsl:template> +<xsl:template match="bibliography/title"></xsl:template> +<xsl:template match="bibliography/subtitle"></xsl:template> +<xsl:template match="bibliography/titleabbrev"></xsl:template> + +<xsl:template match="bibliography/title" mode="component.title.mode"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select=".."/> + </xsl:call-template> + </xsl:variable> + <h2 class="title"> + <a name="{$id}"> + <xsl:apply-templates/> + </a> + </h2> +</xsl:template> + +<xsl:template match="bibliography/subtitle" mode="component.title.mode"> + <h3> + <i><xsl:apply-templates/></i> + </h3> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="bibliodiv"> + <div class="{name(.)}"> + <xsl:apply-templates/> + </div> +</xsl:template> + +<xsl:template match="bibliodiv/title"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select=".."/> + </xsl:call-template> + </xsl:variable> + <h3 class="{name(.)}"> + <a name="{$id}"> + <xsl:apply-templates/> + </a> + </h3> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="biblioentry"> + <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable> + <div id="{$id}" class="{name(.)}"> + <a name="{$id}"/> + <p> + <xsl:apply-templates mode="bibliography.mode"/> + </p> + </div> +</xsl:template> + +<xsl:template match="bibliomixed"> + <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable> + <div id="{$id}" class="{name(.)}"> + <a name="{$id}"/> + <p> + <xsl:choose> + <xsl:when test="local-name(*[1]) = 'abbrev'"> + <xsl:apply-templates select="*[position()>1]|text()" + mode="bibliomixed.mode"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates mode="bibliomixed.mode"/> + </xsl:otherwise> + </xsl:choose> + </p> + </div> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="*" mode="bibliography.mode"> + <xsl:apply-templates select="."/><!-- try the default mode --> +</xsl:template> + +<xsl:template match="abbrev" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:text>[</xsl:text> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:text>] </xsl:text> + </span> +</xsl:template> + +<xsl:template match="abstract" mode="bibliography.mode"> + <!-- suppressed --> +</xsl:template> + +<xsl:template match="address" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="affiliation" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="shortaffil" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="jobtitle" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="artheader|articleinfo" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="artpagenums" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="author" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:call-template name="person.name"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="authorblurb" mode="bibliography.mode"> + <!-- suppressed --> +</xsl:template> + +<xsl:template match="authorgroup" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:call-template name="person.name.list"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="authorinitials" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="bibliomisc" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="bibliomset" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<!-- ================================================== --> + +<xsl:template match="biblioset" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + </span> +</xsl:template> + +<xsl:template match="biblioset/title|biblioset/citetitle" + mode="bibliography.mode"> + <xsl:variable name="relation" select="../@relation"/> + <xsl:choose> + <xsl:when test="$relation='article'"> + <xsl:call-template name="dingbat"> + <xsl:with-param name="dingbat">ldquo</xsl:with-param> + </xsl:call-template> + <xsl:apply-templates/> + <xsl:call-template name="dingbat"> + <xsl:with-param name="dingbat">rdquo</xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <I><xsl:apply-templates/></I> + </xsl:otherwise> + </xsl:choose> + <xsl:value-of select="$biblioentry.item.separator"/> +</xsl:template> + +<!-- ================================================== --> + +<xsl:template match="bookbiblio" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="citetitle" mode="bibliography.mode"> + <span class="{name(.)}"> + <i><xsl:apply-templates mode="bibliography.mode"/></i> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="collab" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="collabname" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="confgroup" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="confdates" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="conftitle" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="confnum" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="confsponsor" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="contractnum" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="contractsponsor" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="contrib" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<!-- ================================================== --> + +<xsl:template match="copyright" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:call-template name="gentext.element.name"/> + <xsl:call-template name="gentext.space"/> + <xsl:call-template name="dingbat"> + <xsl:with-param name="dingbat">copyright</xsl:with-param> + </xsl:call-template> + <xsl:call-template name="gentext.space"/> + <xsl:apply-templates select="year" mode="bibliography.mode"/> + <xsl:if test="holder"> + <xsl:call-template name="gentext.space"/> + <xsl:apply-templates select="holder" mode="bibliography.mode"/> + </xsl:if> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="year" mode="bibliography.mode"> + <xsl:apply-templates/><xsl:text>, </xsl:text> +</xsl:template> + +<xsl:template match="year[position()=last()]" mode="bibliography.mode"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="holder" mode="bibliography.mode"> + <xsl:apply-templates/> +</xsl:template> + +<!-- ================================================== --> + +<xsl:template match="corpauthor" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="corpname" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="date" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="edition" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="editor" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:call-template name="person.name"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="firstname" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="honorific" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="indexterm" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="invpartnumber" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="isbn" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="issn" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="issuenum" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="lineage" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="orgname" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="orgdiv" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="othercredit" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="othername" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="pagenums" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="printhistory" mode="bibliography.mode"> + <!-- suppressed --> +</xsl:template> + +<xsl:template match="productname" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="productnumber" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="pubdate" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="publisher" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + </span> +</xsl:template> + +<xsl:template match="publishername" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="pubsnumber" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="releaseinfo" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="revhistory" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="seriesinfo" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + </span> +</xsl:template> + +<xsl:template match="seriesvolnums" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="subtitle" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="surname" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="title" mode="bibliography.mode"> + <span class="{name(.)}"> + <I><xsl:apply-templates mode="bibliography.mode"/></I> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="titleabbrev" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<xsl:template match="volumenum" mode="bibliography.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliography.mode"/> + <xsl:value-of select="$biblioentry.item.separator"/> + </span> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="*" mode="bibliomixed.mode"> + <xsl:apply-templates select="."/><!-- try the default mode --> +</xsl:template> + +<xsl:template match="abbrev" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="abstract" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="address" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="affiliation" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="shortaffil" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="jobtitle" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="artpagenums" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="author" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="authorblurb" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="authorgroup" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="authorinitials" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="bibliomisc" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<!-- ================================================== --> + +<xsl:template match="bibliomset" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="bibliomset/title|bibliomset/citetitle" + mode="bibliomixed.mode"> + <xsl:variable name="relation" select="../@relation"/> + <xsl:choose> + <xsl:when test="$relation='article'"> + <xsl:call-template name="dingbat"> + <xsl:with-param name="dingbat">ldquo</xsl:with-param> + </xsl:call-template> + <xsl:apply-templates/> + <xsl:call-template name="dingbat"> + <xsl:with-param name="dingbat">rdquo</xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <I><xsl:apply-templates/></I> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- ================================================== --> + +<xsl:template match="biblioset" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="citetitle" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <i><xsl:apply-templates mode="bibliomixed.mode"/></i> + </span> +</xsl:template> + +<xsl:template match="collab" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="confgroup" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="contractnum" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="contractsponsor" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="contrib" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="copyright" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="corpauthor" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="corpname" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="date" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="edition" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="editor" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="firstname" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="honorific" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="indexterm" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="invpartnumber" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="isbn" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="issn" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="issuenum" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="lineage" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="orgname" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="othercredit" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="othername" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="pagenums" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="printhistory" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="productname" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="productnumber" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="pubdate" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="publisher" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="publishername" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="pubsnumber" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="releaseinfo" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="revhistory" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="seriesvolnums" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="subtitle" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="surname" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="title" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="titleabbrev" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<xsl:template match="volumenum" mode="bibliomixed.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="bibliomixed.mode"/> + </span> +</xsl:template> + +<!-- ==================================================================== --> + +</xsl:stylesheet> diff --git a/tests/docbook/html/block.xsl b/tests/docbook/html/block.xsl new file mode 100644 index 00000000..bf53b8db --- /dev/null +++ b/tests/docbook/html/block.xsl @@ -0,0 +1,323 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<!-- ==================================================================== --> + +<xsl:template name="block.object"> + <div class="{name(.)}"> + <a> + <xsl:attribute name="name"> + <xsl:call-template name="object.id"/> + </xsl:attribute> + </a> + <xsl:apply-templates/> + </div> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="para"> + <p> + <xsl:if test="position() = 1 and parent::listitem"> + <a> + <xsl:attribute name="name"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select="parent::listitem"/> + </xsl:call-template> + </xsl:attribute> + </a> + </xsl:if> + + <xsl:if test="@id"> + <a name="{@id}"/> + </xsl:if> + <xsl:apply-templates/> + </p> +</xsl:template> + +<xsl:template match="simpara"> + <p> + <xsl:if test="@id"> + <a name="{@id}"/> + </xsl:if> + <xsl:apply-templates/> + </p> +</xsl:template> + +<xsl:template match="formalpara"> + <p> + <xsl:if test="@id"> + <a name="{@id}"/> + </xsl:if> + <xsl:apply-templates/> + </p> +</xsl:template> + +<xsl:template match="formalpara/title"> + <b><xsl:apply-templates/></b> + <xsl:text> </xsl:text> +</xsl:template> + +<xsl:template match="formalpara/para"> + <xsl:apply-templates/> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="blockquote"> + <xsl:if test="@id"> + <a name="{@id}"/> + </xsl:if> + <xsl:choose> + <xsl:when test="attribution"> + <table border="0" width="100%" + cellspacing="0" cellpadding="0" class="blockquote" + summary="Block quote"> + <tr> + <td width="10%" valign="top"> </td> + <td width="80%" valign="top"> + <xsl:apply-templates + select="child::*[local-name(.)!='attribution']"/> + </td> + <td width="10%" valign="top"> </td> + </tr> + <tr> + <td colspan="2" align="right" valign="top"> + <xsl:text>--</xsl:text> + <xsl:apply-templates select="attribution"/> + </td> + <td width="10%" valign="top"> </td> + </tr> + </table> + </xsl:when> + <xsl:otherwise> + <blockquote class="blockquote"> + <xsl:apply-templates/> + </blockquote> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="epigraph"> + <div class="{name(.)}"> + <xsl:apply-templates select="para"/> + <span>--<xsl:apply-templates select="attribution"/></span> + </div> +</xsl:template> + +<xsl:template match="attribution"> + <span class="{name(.)}"><xsl:apply-templates/></span> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="sidebar"> + <div class="{name(.)}"> + <a> + <xsl:attribute name="name"> + <xsl:call-template name="object.id"/> + </xsl:attribute> + </a> + + <xsl:apply-templates/> + </div> +</xsl:template> + +<xsl:template match="sidebar/title"> + <p class="title"> + <b><xsl:apply-templates/></b> + </p> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="abstract"> + <div class="{name(.)}"> + <xsl:call-template name="formal.object.heading"> + <xsl:with-param name="title"> + <xsl:apply-templates select="." mode="title.ref"/> + </xsl:with-param> + </xsl:call-template> + <xsl:apply-templates/> + </div> +</xsl:template> + +<xsl:template match="abstract/title"> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="msgset"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="msgentry"> + <xsl:call-template name="block.object"/> +</xsl:template> + +<xsl:template match="simplemsgentry"> + <xsl:call-template name="block.object"/> +</xsl:template> + +<xsl:template match="msg"> + <xsl:call-template name="block.object"/> +</xsl:template> + +<xsl:template match="msgmain"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="msgmain/title"> + <b><xsl:apply-templates/></b> +</xsl:template> + +<xsl:template match="msgsub"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="msgsub/title"> + <b><xsl:apply-templates/></b> +</xsl:template> + +<xsl:template match="msgrel"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="msgrel/title"> + <b><xsl:apply-templates/></b> +</xsl:template> + +<xsl:template match="msgtext"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="msginfo"> + <xsl:call-template name="block.object"/> +</xsl:template> + +<xsl:template match="msglevel|msgorig|msgaud"> + <p> + <b> + <xsl:call-template name="gentext.element.name"/> + <xsl:text>: </xsl:text> + </b> + <xsl:apply-templates/> + </p> +</xsl:template> + +<xsl:template match="msgexplan"> + <xsl:call-template name="block.object"/> +</xsl:template> + +<xsl:template match="msgexplan/title"> + <p><b><xsl:apply-templates/></b></p> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="revhistory"> + <div class="{name(.)}"> + <table border="0" width="100%" summary="Revision history"> + <tr> + <th align="left" valign="top" colspan="3"> + <b><xsl:call-template name="gentext.element.name"/></b> + </th> + </tr> + <xsl:apply-templates/> + </table> + </div> +</xsl:template> + +<xsl:template match="revhistory/revision"> + <xsl:variable name="revnumber" select=".//revnumber"/> + <xsl:variable name="revdate" select=".//date"/> + <xsl:variable name="revauthor" select=".//authorinitials"/> + <xsl:variable name="revremark" select=".//revremark|../revdescription"/> + <tr> + <td align="left"> + <xsl:if test="$revnumber"> + <xsl:call-template name="gentext.element.name"/> + <xsl:text> </xsl:text> + <xsl:apply-templates select="$revnumber"/> + </xsl:if> + </td> + <td align="left"> + <xsl:apply-templates select="$revdate"/> + </td> + <xsl:choose> + <xsl:when test="count($revauthor)=0"> + <td align="left"> + <xsl:call-template name="dingbat"> + <xsl:with-param name="dingbat">nbsp</xsl:with-param> + </xsl:call-template> + </td> + </xsl:when> + <xsl:otherwise> + <td align="left"> + <xsl:apply-templates select="$revauthor"/> + </td> + </xsl:otherwise> + </xsl:choose> + </tr> + <xsl:if test="$revremark"> + <tr> + <td align="left" colspan="3"> + <xsl:apply-templates select="$revremark"/> + </td> + </tr> + </xsl:if> +</xsl:template> + +<xsl:template match="revision/revnumber"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="revision/date"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="revision/authorinitials"> + <xsl:text>, </xsl:text> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="revision/authorinitials[1]" priority="2"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="revision/revremark"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="revision/revdescription"> + <xsl:apply-templates/> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="ackno"> + <p class="{name(.)}"> + <xsl:apply-templates/> + </p> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="highlights"> + <xsl:call-template name="block.object"/> +</xsl:template> + +<!-- ==================================================================== --> + +</xsl:stylesheet> diff --git a/tests/docbook/html/callout.xsl b/tests/docbook/html/callout.xsl new file mode 100644 index 00000000..68ca333d --- /dev/null +++ b/tests/docbook/html/callout.xsl @@ -0,0 +1,127 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:verb5="http://nwalsh.com/com.nwalsh.saxon.Verbatim" + xmlns:verb6="http://nwalsh.com/com.nwalsh.saxon6.Verbatim" + exclude-result-prefixes="verb5 verb6" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<xsl:template match="programlistingco|screenco"> + <xsl:variable name="verbatim" select="programlisting|screen"/> + <xsl:variable name="vendor" select="system-property('xsl:vendor')"/> + + <xsl:choose> + <xsl:when test="$saxon.extensions != '0' + and $saxon.callouts != '0'"> + <xsl:variable name="rtf"> + <xsl:apply-templates select="$verbatim"> + <xsl:with-param name="suppress-numbers" select="'1'"/> + </xsl:apply-templates> + </xsl:variable> + <xsl:variable name="rtf-with-callouts"> + <xsl:choose> + <xsl:when test="contains($vendor, 'SAXON 6')"> + <xsl:copy-of select="verb6:insertCallouts(areaspec,$rtf)"/> + </xsl:when> + <xsl:when test="$callout.graphics != 0"> + <xsl:copy-of select="verb5:insertCallouts(areaspec,$rtf, + $callout.defaultcolumn, + $callout.graphics.path, + $callout.graphics.extension, + $callout.graphics.number.limit, + false())"/> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="verb5:insertCallouts(areaspec,$rtf, + $callout.defaultcolumn)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:choose> + <xsl:when test="$verbatim/@linenumbering = 'numbered' + and $saxon.extensions != '0' + and $saxon.linenumbering != '0'"> + <div class="{name(.)}"> + <xsl:choose> + <xsl:when test="contains($vendor, 'SAXON 6')"> + <xsl:copy-of select="verb6:numberLines($rtf-with-callouts)"/> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="verb5:numberLines($rtf-with-callouts, + $linenumbering.everyNth, + $linenumbering.width, + $linenumbering.separator)"/> + </xsl:otherwise> + </xsl:choose> + <xsl:apply-templates select="calloutlist"/> + </div> + </xsl:when> + <xsl:otherwise> + <div class="{name(.)}"> + <xsl:copy-of select="$rtf-with-callouts"/> + <xsl:apply-templates select="calloutlist"/> + </div> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <div class="{name(.)}"> + <xsl:apply-templates/> + </div> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="areaspec|areaset|area"> +</xsl:template> + +<xsl:template match="areaset" mode="conumber"> + <xsl:number count="area|areaset" format="1"/> +</xsl:template> + +<xsl:template match="area" mode="conumber"> + <xsl:number count="area|areaset" format="1"/> +</xsl:template> + +<xsl:template match="co"> + <a name="{@id}"/> + <xsl:apply-templates select="." mode="callout-bug"/> +</xsl:template> + +<xsl:template match="co" mode="callout-bug"> + <xsl:call-template name="callout-bug"> + <xsl:with-param name="conum"> + <xsl:number count="co" format="1"/> + </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template name="callout-bug"> + <xsl:param name="conum" select='1'/> + + <xsl:choose> + <xsl:when test="$callout.graphics = '0' + or $conum > $callout.graphics.number.limit"> + + <xsl:text>(</xsl:text> + <xsl:value-of select="$conum"/> + <xsl:text>)</xsl:text> + </xsl:when> + <xsl:otherwise> + <img src="{$callout.graphics.path}{$conum}{$callout.graphics.extension}" + alt="{$conum}" border="0"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +</xsl:stylesheet> diff --git a/tests/docbook/html/changebars.xsl b/tests/docbook/html/changebars.xsl new file mode 100644 index 00000000..fee001a1 --- /dev/null +++ b/tests/docbook/html/changebars.xsl @@ -0,0 +1,73 @@ +<?xml version="1.0"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + +<xsl:import href="docbook.xsl"/> + +<xsl:param name="show.revisionflag" select="'1'"/> + +<xsl:template name="user.head.content"> +<style type="text/css"> +<xsl:text> +div.added { background-color: yellow; } +div.deleted { text-decoration: line-through; + background-color: #FF7F7F; } +div.changed { background-color: lime; } +div.off { } + +span.added { background-color: yellow; } +span.deleted { text-decoration: line-through; + background-color: #FF7F7F; } +span.changed { background-color: lime; } +span.off { } +</xsl:text> +</style> +</xsl:template> + +<xsl:template match="*[@revisionflag]"> + <xsl:choose> + <xsl:when test="local-name(.) = 'para' + or local-name(.) = 'section' + or local-name(.) = 'sect1' + or local-name(.) = 'sect2' + or local-name(.) = 'sect3' + or local-name(.) = 'sect4' + or local-name(.) = 'sect5' + or local-name(.) = 'chapter' + or local-name(.) = 'preface' + or local-name(.) = 'itemizedlist' + or local-name(.) = 'appendix'"> + <div class='{@revisionflag}'> + <xsl:apply-imports/> + </div> + </xsl:when> + <xsl:when test="local-name(.) = 'phrase' + or local-name(.) = 'ulink' + or local-name(.) = 'filename' + or local-name(.) = 'literal' + or local-name(.) = 'emphasis' + or local-name(.) = 'command' + or local-name(.) = 'xref'"> + <span class='{@revisionflag}'> + <xsl:apply-imports/> + </span> + </xsl:when> + <xsl:when test="local-name(.) = 'listitem' + or local-name(.) = 'title'"> + <!-- nop; these are handled directly in the stylesheet --> + <xsl:apply-imports/> + </xsl:when> + <xsl:otherwise> + <xsl:message> + <xsl:text>Revisionflag on unexpected element: </xsl:text> + <xsl:value-of select="local-name(.)"/> + <xsl:text>(Assuming block)</xsl:text> + </xsl:message> + <div class='{@revisionflag}'> + <xsl:apply-imports/> + </div> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +</xsl:stylesheet> diff --git a/tests/docbook/html/chunk-common.xsl b/tests/docbook/html/chunk-common.xsl new file mode 100644 index 00000000..4b3221a1 --- /dev/null +++ b/tests/docbook/html/chunk-common.xsl @@ -0,0 +1,755 @@ +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:saxon="http://icl.com/saxon" + xmlns:lxslt="http://xml.apache.org/xslt" + xmlns:xalanredirect="org.apache.xalan.xslt.extensions.Redirect" + xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" + version="1.0" + exclude-result-prefixes="doc" + extension-element-prefixes="saxon xalanredirect lxslt"> + +<xsl:import href="docbook.xsl"/> + +<xsl:output method="html" + encoding="ISO-8859-1" + indent="no"/> + +<xsl:param name="html.ext" select="'.html'"/> +<xsl:param name="root.filename" select="'index'"/> +<xsl:param name="base.dir" select="''"/> +<doc:param name="base.dir" xmlns=""> +<refpurpose>Output directory for chunks</refpurpose> +<refdescription> +<para>If specified, the <literal>base.dir</literal> identifies +the output directory for chunks. (If not specified, the output directory +is system dependent.)</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<!-- What's a chunk? + + appendix + article + bibliography in article or book + book + chapter + colophon + glossary in article or book + index in article or book + part + preface + refentry + reference + sect1 if position()>1 + section if position()>1 && parent != section + set + setindex + --> +<!-- ==================================================================== --> + +<xsl:template name="chunk"> + <xsl:param name="node" select="."/> + <!-- returns 1 if $node is a chunk --> + + <xsl:choose> + <xsl:when test="name($node)='sect1' + and count($node/preceding-sibling::sect1) > 0">1</xsl:when> + <xsl:when test="name($node)='section' + and count($node/parent::section) = 0 + and count($node/preceding-sibling::section) > 0">1</xsl:when> + <xsl:when test="name($node)='preface'">1</xsl:when> + <xsl:when test="name($node)='chapter'">1</xsl:when> + <xsl:when test="name($node)='appendix'">1</xsl:when> + <xsl:when test="name($node)='article'">1</xsl:when> + <xsl:when test="name($node)='part'">1</xsl:when> + <xsl:when test="name($node)='reference'">1</xsl:when> + <xsl:when test="name($node)='refentry'">1</xsl:when> + <xsl:when test="name($node)='index' + and (name($node/parent::*) = 'article' + or name($node/parent::*) = 'book')">1</xsl:when> + <xsl:when test="name($node)='bibliography' + and (name($node/parent::*) = 'article' + or name($node/parent::*) = 'book')">1</xsl:when> + <xsl:when test="name($node)='glossary' + and (name($node/parent::*) = 'article' + or name($node/parent::*) = 'book')">1</xsl:when> + <xsl:when test="name($node)='colophon'">1</xsl:when> + <xsl:when test="name($node)='book'">1</xsl:when> + <xsl:when test="name($node)='set'">1</xsl:when> + <xsl:when test="name($node)='setindex'">1</xsl:when> + <xsl:otherwise>0</xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="*" mode="chunk-filename"> + <xsl:param name="recursive" select="false()"/> + + <!-- returns the filename of a chunk --> + <xsl:variable name="ischunk"><xsl:call-template name="chunk"/></xsl:variable> + <xsl:variable name="filename"> + <xsl:call-template name="dbhtml-filename"/> + </xsl:variable> + <xsl:variable name="dir"> + <xsl:call-template name="dbhtml-dir"/> + </xsl:variable> + + <xsl:choose> + <xsl:when test="$ischunk='0'"> + <!-- if called on something that isn't a chunk, walk up... --> + <xsl:choose> + <xsl:when test="count(parent::*)>0"> + <xsl:apply-templates mode="chunk-filename" select="parent::*"> + <xsl:with-param name="recursive" select="$recursive"/> + </xsl:apply-templates> + </xsl:when> + <!-- unless there is no up, in which case return "" --> + <xsl:otherwise></xsl:otherwise> + </xsl:choose> + </xsl:when> + + <xsl:when test="not($recursive) and $filename != ''"> + <!-- if this chunk has an explicit name, use it --> + <xsl:if test="$dir != ''"> + <xsl:value-of select="$dir"/> + <xsl:text>/</xsl:text> + </xsl:if> + <xsl:value-of select="$filename"/> + </xsl:when> + + <xsl:when test="name(.)='set'"> + <xsl:value-of select="$root.filename"/> + <xsl:if test="not($recursive)"> + <xsl:value-of select="$html.ext"/> + </xsl:if> + </xsl:when> + + <xsl:when test="name(.)='book'"> + <xsl:choose> + <xsl:when test="count(parent::*)>0"> + <xsl:text>bk</xsl:text> + <xsl:number level="any" format="01"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$root.filename"/> + </xsl:otherwise> + </xsl:choose> + <xsl:if test="not($recursive)"> + <xsl:value-of select="$html.ext"/> + </xsl:if> + </xsl:when> + + <xsl:when test="name(.)='article'"> + <xsl:choose> + <xsl:when test="/set"> + <!-- in a set, make sure we inherit the right book info... --> + <xsl:apply-templates mode="chunk-filename" select="parent::*"> + <xsl:with-param name="recursive" select="true()"/> + </xsl:apply-templates> + </xsl:when> + <xsl:when test="count(parent::*)>0"> + <!-- if we aren't the root, name them numerically ... --> + <xsl:text>ar</xsl:text> + <xsl:number level="any" format="01" from="book"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$root.filename"/> + </xsl:otherwise> + </xsl:choose> + <xsl:if test="not($recursive)"> + <xsl:value-of select="$html.ext"/> + </xsl:if> + </xsl:when> + + <xsl:when test="name(.)='preface'"> + <xsl:if test="/set"> + <xsl:apply-templates mode="chunk-filename" select="parent::*"> + <xsl:with-param name="recursive" select="true()"/> + </xsl:apply-templates> + </xsl:if> + <xsl:text>pr</xsl:text> + <xsl:number level="any" format="01" from="book"/> + <xsl:if test="not($recursive)"> + <xsl:value-of select="$html.ext"/> + </xsl:if> + </xsl:when> + + <xsl:when test="name(.)='chapter'"> + <xsl:if test="/set"> + <xsl:apply-templates mode="chunk-filename" select="parent::*"> + <xsl:with-param name="recursive" select="true()"/> + </xsl:apply-templates> + </xsl:if> + <xsl:text>ch</xsl:text> + <xsl:number level="any" format="01" from="book"/> + <xsl:if test="not($recursive)"> + <xsl:value-of select="$html.ext"/> + </xsl:if> + </xsl:when> + + <xsl:when test="name(.)='appendix'"> + <xsl:if test="/set"> + <xsl:apply-templates mode="chunk-filename" select="parent::*"> + <xsl:with-param name="recursive" select="true()"/> + </xsl:apply-templates> + </xsl:if> + <xsl:text>ap</xsl:text> + <xsl:number level="any" format="a" from="book"/> + <xsl:if test="not($recursive)"> + <xsl:value-of select="$html.ext"/> + </xsl:if> + </xsl:when> + + <xsl:when test="name(.)='part'"> + <xsl:if test="/set"> + <xsl:apply-templates mode="chunk-filename" select="parent::*"> + <xsl:with-param name="recursive" select="true()"/> + </xsl:apply-templates> + </xsl:if> + <xsl:text>pt</xsl:text> + <xsl:number level="any" format="01" from="book"/> + <xsl:if test="not($recursive)"> + <xsl:value-of select="$html.ext"/> + </xsl:if> + </xsl:when> + + <xsl:when test="name(.)='reference'"> + <xsl:if test="/set"> + <xsl:apply-templates mode="chunk-filename" select="parent::*"> + <xsl:with-param name="recursive" select="true()"/> + </xsl:apply-templates> + </xsl:if> + <xsl:text>rn</xsl:text> + <xsl:number level="any" format="01" from="book"/> + <xsl:if test="not($recursive)"> + <xsl:value-of select="$html.ext"/> + </xsl:if> + </xsl:when> + + <xsl:when test="name(.)='refentry'"> + <xsl:if test="parent::reference"> + <xsl:apply-templates mode="chunk-filename" select="parent::*"> + <xsl:with-param name="recursive" select="true()"/> + </xsl:apply-templates> + </xsl:if> + <xsl:text>re</xsl:text> + <xsl:number level="any" format="01" from="book"/> + <xsl:if test="not($recursive)"> + <xsl:value-of select="$html.ext"/> + </xsl:if> + </xsl:when> + + <xsl:when test="name(.)='colophon'"> + <xsl:if test="/set"> + <xsl:apply-templates mode="chunk-filename" select="parent::*"> + <xsl:with-param name="recursive" select="true()"/> + </xsl:apply-templates> + </xsl:if> + <xsl:text>co</xsl:text> + <xsl:number level="any" format="01" from="book"/> + <xsl:if test="not($recursive)"> + <xsl:value-of select="$html.ext"/> + </xsl:if> + </xsl:when> + + <xsl:when test="name(.)='sect1' or name(.)='section'"> + <xsl:apply-templates mode="chunk-filename" select="parent::*"> + <xsl:with-param name="recursive" select="true()"/> + </xsl:apply-templates> + <xsl:text>s</xsl:text> + <xsl:number level="any" format="01" from="preface|chapter|appendix"/> + <xsl:if test="not($recursive)"> + <xsl:value-of select="$html.ext"/> + </xsl:if> + </xsl:when> + + <xsl:when test="name(.)='bibliography'"> + <xsl:if test="/set"> + <xsl:apply-templates mode="chunk-filename" select="parent::*"> + <xsl:with-param name="recursive" select="true()"/> + </xsl:apply-templates> + </xsl:if> + <xsl:text>bi</xsl:text> + <xsl:number level="any" format="01" from="book"/> + <xsl:if test="not($recursive)"> + <xsl:value-of select="$html.ext"/> + </xsl:if> + </xsl:when> + + <xsl:when test="name(.)='glossary'"> + <xsl:if test="/set"> + <xsl:apply-templates mode="chunk-filename" select="parent::*"> + <xsl:with-param name="recursive" select="true()"/> + </xsl:apply-templates> + </xsl:if> + <xsl:text>go</xsl:text> + <xsl:number level="any" format="01" from="book"/> + <xsl:if test="not($recursive)"> + <xsl:value-of select="$html.ext"/> + </xsl:if> + </xsl:when> + + <xsl:when test="name(.)='index'"> + <xsl:if test="/set"> + <xsl:apply-templates mode="chunk-filename" select="parent::*"> + <xsl:with-param name="recursive" select="true()"/> + </xsl:apply-templates> + </xsl:if> + <xsl:text>ix</xsl:text> + <xsl:number level="any" format="01" from="book"/> + <xsl:if test="not($recursive)"> + <xsl:value-of select="$html.ext"/> + </xsl:if> + </xsl:when> + + <xsl:when test="name(.)='setindex'"> + <xsl:text>si</xsl:text> + <xsl:number level="any" format="01" from="set"/> + <xsl:if test="not($recursive)"> + <xsl:value-of select="$html.ext"/> + </xsl:if> + </xsl:when> + + <xsl:otherwise> + <xsl:text>chunk-filename-error-</xsl:text> + <xsl:value-of select="name(.)"/> + <xsl:number level="any" format="01" from="set"/> + <xsl:if test="not($recursive)"> + <xsl:value-of select="$html.ext"/> + </xsl:if> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template name="href.target"> + <xsl:param name="object" select="."/> + <xsl:variable name="ischunk"> + <xsl:call-template name="chunk"> + <xsl:with-param name="node" select="$object"/> + </xsl:call-template> + </xsl:variable> + + <xsl:apply-templates mode="chunk-filename" select="$object"/> + + <xsl:if test="$ischunk='0'"> + <xsl:text>#</xsl:text> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select="$object"/> + </xsl:call-template> + </xsl:if> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template name="html.head"> + <xsl:param name="prev" select="/foo"/> + <xsl:param name="next" select="/foo"/> + <xsl:variable name="home" select="/*[1]"/> + <xsl:variable name="up" select="parent::*"/> + + <head> + <xsl:call-template name="head.content"/> + <xsl:call-template name="user.head.content"/> + + <xsl:if test="$home"> + <link rel="home"> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$home"/> + </xsl:call-template> + </xsl:attribute> + <xsl:attribute name="title"> + <xsl:apply-templates select="$home" mode="title.ref"> + <xsl:with-param name="text-only" select="'1'"/> + </xsl:apply-templates> + </xsl:attribute> + </link> + </xsl:if> + + <xsl:if test="$up"> + <link rel="up"> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$up"/> + </xsl:call-template> + </xsl:attribute> + <xsl:attribute name="title"> + <xsl:apply-templates select="$up" mode="title.ref"> + <xsl:with-param name="text-only" select="'1'"/> + </xsl:apply-templates> + </xsl:attribute> + </link> + </xsl:if> + + <xsl:if test="$prev"> + <link rel="previous"> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$prev"/> + </xsl:call-template> + </xsl:attribute> + <xsl:attribute name="title"> + <xsl:apply-templates select="$prev" mode="title.ref"> + <xsl:with-param name="text-only" select="'1'"/> + </xsl:apply-templates> + </xsl:attribute> + </link> + </xsl:if> + + <xsl:if test="$next"> + <link rel="next"> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$next"/> + </xsl:call-template> + </xsl:attribute> + <xsl:attribute name="title"> + <xsl:apply-templates select="$next" mode="title.ref"> + <xsl:with-param name="text-only" select="'1'"/> + </xsl:apply-templates> + </xsl:attribute> + </link> + </xsl:if> + </head> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template name="header.navigation"> + <xsl:param name="prev" select="/foo"/> + <xsl:param name="next" select="/foo"/> + <xsl:variable name="home" select="/*[1]"/> + <xsl:variable name="up" select="parent::*"/> + + <xsl:if test="$suppress.navigation = '0'"> + <div class="navheader"> + <table width="100%"> + <tr> + <th colspan="3" align="center"> + <xsl:apply-templates select="." mode="title.ref"/> + </th> + </tr> + <tr> + <td width="20%" align="left"> + <xsl:if test="count($prev)>0"> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$prev"/> + </xsl:call-template> + </xsl:attribute> + <xsl:call-template name="gentext.nav.prev"/> + </a> + </xsl:if> + <xsl:text> </xsl:text> + </td> + <th width="60%" align="center"> + <xsl:choose> + <xsl:when test="count($up) > 0 and $up != $home"> + <xsl:apply-templates select="$up" mode="title.ref"/> + </xsl:when> + <xsl:otherwise> </xsl:otherwise> + </xsl:choose> + </th> + <td width="20%" align="right"> + <xsl:text> </xsl:text> + <xsl:if test="count($next)>0"> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$next"/> + </xsl:call-template> + </xsl:attribute> + <xsl:call-template name="gentext.nav.next"/> + </a> + </xsl:if> + </td> + </tr> + </table> + <hr/> + </div> + </xsl:if> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template name="footer.navigation"> + <xsl:param name="prev" select="/foo"/> + <xsl:param name="next" select="/foo"/> + <xsl:variable name="home" select="/*[1]"/> + <xsl:variable name="up" select="parent::*"/> + + <xsl:if test="$suppress.navigation = '0'"> + <div class="navfooter"> + <hr/> + <table width="100%"> + <tr> + <td width="40%" align="left"> + <xsl:if test="count($prev)>0"> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$prev"/> + </xsl:call-template> + </xsl:attribute> + <xsl:call-template name="gentext.nav.prev"/> + </a> + </xsl:if> + <xsl:text> </xsl:text> + </td> + <td width="20%" align="center"> + <xsl:choose> + <xsl:when test="$home != ."> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$home"/> + </xsl:call-template> + </xsl:attribute> + <xsl:call-template name="gentext.nav.home"/> + </a> + </xsl:when> + <xsl:otherwise> </xsl:otherwise> + </xsl:choose> + </td> + <td width="40%" align="right"> + <xsl:text> </xsl:text> + <xsl:if test="count($next)>0"> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$next"/> + </xsl:call-template> + </xsl:attribute> + <xsl:call-template name="gentext.nav.next"/> + </a> + </xsl:if> + </td> + </tr> + + <tr> + <td width="40%" align="left"> + <xsl:apply-templates select="$prev" mode="title.ref"/> + <xsl:text> </xsl:text> + </td> + <td width="20%" align="center"> + <xsl:choose> + <xsl:when test="count($up)>0"> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$up"/> + </xsl:call-template> + </xsl:attribute> + <xsl:call-template name="gentext.nav.up"/> + </a> + </xsl:when> + <xsl:otherwise> </xsl:otherwise> + </xsl:choose> + </td> + <td width="40%" align="right"> + <xsl:text> </xsl:text> + <xsl:apply-templates select="$next" mode="title.ref"/> + </td> + </tr> + </table> + </div> + </xsl:if> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="processing-instruction('dbhtml')"> + <!-- nop --> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template name="process-chunk-element"> + <xsl:variable name="root" select="count(parent::*) > 0"/> + + <xsl:variable name="prev" + select="(preceding::book[1] + |preceding::preface[1] + |preceding::chapter[1] + |preceding::appendix[1] + |preceding::part[1] + |preceding::reference[1] + |preceding::refentry[1] + |preceding::colophon[1] + |preceding::sect1[name(preceding-sibling::*[1]) = 'sect1'][1] + |preceding::section[name(preceding-sibling::*[1]) = 'section' + and name(parent::*) != 'section'][1] + |preceding::article[1] + |preceding::bibliography[1] + |preceding::glossary[1] + |preceding::index[1] + |preceding::setindex[1] + |ancestor::set + |ancestor::book[1] + |ancestor::preface[1] + |ancestor::chapter[1] + |ancestor::appendix[1] + |ancestor::part[1] + |ancestor::reference[1] + |ancestor::article[1])[last()]"/> + + <xsl:variable name="next" + select="(following::book[1] + |following::preface[1] + |following::chapter[1] + |following::appendix[1] + |following::part[1] + |following::reference[1] + |following::refentry[1] + |following::colophon[1] + |following::sect1[1] + |following::section[name(parent::*) != 'section'][1] + |following::bibliography[1] + |following::glossary[1] + |following::index[1] + |following::article[1] + |following::setindex[1] + |descendant::book[1] + |descendant::preface[1] + |descendant::chapter[1] + |descendant::appendix[1] + |descendant::article[1] + |descendant::bibliography[1] + |descendant::glossary[1] + |descendant::index[1] + |descendant::colophon[1] + |descendant::setindex[1] + |descendant::part[1] + |descendant::reference[1] + |descendant::refentry[1] + |descendant::sect1[2] + |descendant::section[name(parent::*) != 'section'][2])[1]"/> + + <xsl:variable name="ischunk"> + <xsl:call-template name="chunk"/> + </xsl:variable> + + <xsl:variable name="chunkfn"> + <xsl:if test="$ischunk='1'"> + <xsl:apply-templates mode="chunk-filename" select="."/> + </xsl:if> + </xsl:variable> + + <xsl:if test="$ischunk='0'"> + <xsl:message> + <xsl:text>Error </xsl:text> + <xsl:value-of select="name(.)"/> + <xsl:text> is not a chunk!</xsl:text> + </xsl:message> + </xsl:if> + + <xsl:variable name="filename"> + <xsl:call-template name="make-relative-filename"> + <xsl:with-param name="base.dir" select="$base.dir"/> + <xsl:with-param name="base.name" select="$chunkfn"/> + </xsl:call-template> + </xsl:variable> + + <xsl:message> + <xsl:text>Writing </xsl:text> + <xsl:value-of select="$filename"/> + <xsl:text> for </xsl:text> + <xsl:value-of select="name(.)"/> + </xsl:message> + + <xsl:call-template name="write.chunk"> + <xsl:with-param name="filename" select="$filename"/> + <xsl:with-param name="content"> + <xsl:call-template name="chunk-element-content"> + <xsl:with-param name="prev" select="$prev"/> + <xsl:with-param name="next" select="$next"/> + </xsl:call-template> + </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template name="chunk-element-content"> + <xsl:param name="prev"></xsl:param> + <xsl:param name="next"></xsl:param> + + <html> + <xsl:call-template name="html.head"> + <xsl:with-param name="prev" select="$prev"/> + <xsl:with-param name="next" select="$next"/> + </xsl:call-template> + + <body xsl:use-attribute-sets="body.attrs"> + <xsl:call-template name="header.navigation"> + <xsl:with-param name="prev" select="$prev"/> + <xsl:with-param name="next" select="$next"/> + </xsl:call-template> + + <xsl:call-template name="user.header.content"/> + + <xsl:apply-imports/> + + <xsl:call-template name="user.footer.content"/> + + <xsl:call-template name="footer.navigation"> + <xsl:with-param name="prev" select="$prev"/> + <xsl:with-param name="next" select="$next"/> + </xsl:call-template> + </body> + </html> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="/"> + <xsl:choose> + <xsl:when test="$rootid != ''"> + <xsl:choose> + <xsl:when test="count(id($rootid)) = 0"> + <xsl:message terminate="yes"> + <xsl:text>ID '</xsl:text> + <xsl:value-of select="$rootid"/> + <xsl:text>' not found in document.</xsl:text> + </xsl:message> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="id($rootid)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="set|book|part|preface|chapter|appendix + |article + |reference|refentry + |sect1[position()>1] + |section[position()>1 and name(parent::*) != 'section'] + |book/glossary|article/glossary + |book/bibliography|article/bibliography + |colophon"> + <xsl:call-template name="process-chunk-element"/> +</xsl:template> + +<xsl:template match="setindex + |book/index + |article/index"> + <!-- some implementations use completely empty index tags to indicate --> + <!-- where an automatically generated index should be inserted. so --> + <!-- if the index is completely empty, skip it. --> + <xsl:if test="count(*)>0"> + <xsl:call-template name="process-chunk-element"/> + </xsl:if> +</xsl:template> + +<!-- ==================================================================== --> + +</xsl:stylesheet> diff --git a/tests/docbook/html/chunk.xsl b/tests/docbook/html/chunk.xsl new file mode 100644 index 00000000..250c2967 --- /dev/null +++ b/tests/docbook/html/chunk.xsl @@ -0,0 +1,67 @@ +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:saxon="http://icl.com/saxon" + xmlns:lxslt="http://xml.apache.org/xslt" + xmlns:xalanredirect="org.apache.xalan.xslt.extensions.Redirect" + xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" + version="1.0" + exclude-result-prefixes="doc" + extension-element-prefixes="saxon xalanredirect lxslt"> + +<!-- This stylesheet does not work with XT. Use xtchunk.xsl instead. --> + +<xsl:include href="chunk-common.xsl"/> + +<!-- ==================================================================== --> +<!-- This is a workaround for a XalanJ1 bug in element-available. --> + +<lxslt:component prefix="xalanredirect" elements="write"> + <lxslt:script lang="javaclass" + src="org.apache.xalan.xslt.extensions.Redirect"/> +</lxslt:component> + +<!-- ==================================================================== --> + +<xsl:template name="make-relative-filename"> + <xsl:param name="base.dir" select="'./'"/> + <xsl:param name="base.name" select="''"/> + + <xsl:choose> + <xsl:when test="element-available('xalanredirect:write')"> + <!-- Xalan doesn't make the chunks relative --> + <xsl:value-of select="concat($base.dir,$base.name)"/> + </xsl:when> + <xsl:when test="element-available('saxon:output')"> + <!-- Saxon doesn't make the chunks relative --> + <xsl:value-of select="concat($base.dir,$base.name)"/> + </xsl:when> + <!-- XT makes chunks relative, but it doesn't support --> + <!-- element-available() so use xtchunk.xsl instead. --> + <xsl:otherwise> + <!-- it doesn't matter since we won't be making chunks... --> + <xsl:value-of select="$base.name"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="write.chunk"> + <xsl:param name="filename" select="''"/> + <xsl:param name="method" select="'html'"/> + <xsl:param name="encoding" select="'ISO-8859-1'"/> + <xsl:param name="content" select="''"/> + + <xalanredirect:write file="{$filename}"> + <xsl:copy-of select="$content"/> + <xsl:fallback> + <saxon:output file="{$filename}" + method="{$method}" + encoding="{$encoding}"> + <xsl:copy-of select="$content"/> + <xsl:fallback> + <xsl:copy-of select="$content"/> + </xsl:fallback> + </saxon:output> + </xsl:fallback> + </xalanredirect:write> +</xsl:template> + +</xsl:stylesheet> diff --git a/tests/docbook/html/component.xsl b/tests/docbook/html/component.xsl new file mode 100644 index 00000000..63e46e57 --- /dev/null +++ b/tests/docbook/html/component.xsl @@ -0,0 +1,277 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<!-- ==================================================================== --> + +<xsl:template name="component.title"> + <xsl:param name="node" select="."/> + <xsl:variable name="id"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select="$node"/> + </xsl:call-template> + </xsl:variable> + + <h2 class="title"> + <a name="{$id}"/> + <xsl:apply-templates select="$node" mode="title.ref"> + <xsl:with-param name="allow-anchors" select="'1'"/> + </xsl:apply-templates> + </h2> +</xsl:template> + +<xsl:template name="component.subtitle"> + <xsl:param name="node" select="."/> + <xsl:variable name="subtitle"> + <xsl:apply-templates select="$node" mode="subtitle.content"/> + </xsl:variable> + + <xsl:if test="$subtitle != ''"> + <h3 class="subtitle"> + <i> + <xsl:copy-of select="$subtitle"/> + </i> + </h3> + </xsl:if> +</xsl:template> + +<xsl:template name="component.separator"> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="dedication" mode="dedication"> + <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable> + <div id="{$id}" class="{name(.)}"> + <xsl:call-template name="dedication.titlepage"/> + <xsl:apply-templates/> + <xsl:call-template name="process.footnotes"/> + </div> +</xsl:template> + +<xsl:template match="dedication"></xsl:template> <!-- see mode="dedication" --> +<xsl:template match="dedication/title"></xsl:template> +<xsl:template match="dedication/subtitle"></xsl:template> +<xsl:template match="dedication/titleabbrev"></xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="colophon"> + <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable> + <div id="{$id}" class="{name(.)}"> + <xsl:call-template name="component.separator"/> + <xsl:call-template name="component.title"/> + <xsl:call-template name="component.subtitle"/> + + <xsl:apply-templates/> + <xsl:call-template name="process.footnotes"/> + </div> +</xsl:template> + +<xsl:template match="colophon/title"></xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="preface"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + + <div id="{$id}" class="{name(.)}"> + <xsl:call-template name="component.separator"/> + <xsl:call-template name="preface.titlepage"/> + <xsl:if test="$generate.preface.toc != '0'"> + <xsl:call-template name="component.toc"/> + </xsl:if> + <xsl:apply-templates/> + <xsl:call-template name="process.footnotes"/> + </div> +</xsl:template> + +<xsl:template match="title" mode="preface.titlepage.recto.mode"> + <xsl:call-template name="component.title"> + <xsl:with-param name="node" select="ancestor::preface[1]"/> + </xsl:call-template> +</xsl:template> + +<xsl:template match="preface/docinfo|prefaceinfo"></xsl:template> +<xsl:template match="preface/title"></xsl:template> +<xsl:template match="preface/titleabbrev"></xsl:template> +<xsl:template match="preface/subtitle"></xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="chapter"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + + <div id="{$id}" class="{name(.)}"> + <xsl:call-template name="component.separator"/> + <xsl:call-template name="chapter.titlepage"/> + <xsl:if test="$generate.chapter.toc != '0'"> + <xsl:call-template name="component.toc"/> + </xsl:if> + <xsl:apply-templates/> + <xsl:call-template name="process.footnotes"/> + </div> +</xsl:template> + +<xsl:template match="title" mode="chapter.titlepage.recto.mode"> + <xsl:call-template name="component.title"> + <xsl:with-param name="node" select="ancestor::chapter[1]"/> + </xsl:call-template> +</xsl:template> + +<xsl:template match="chapter/docinfo|chapterinfo"></xsl:template> +<xsl:template match="chapter/title"></xsl:template> +<xsl:template match="chapter/titleabbrev"></xsl:template> +<xsl:template match="chapter/subtitle"></xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="appendix"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + + <div id="{$id}" class="{name(.)}"> + <xsl:call-template name="component.separator"/> + <xsl:call-template name="appendix.titlepage"/> + <xsl:if test="$generate.appendix.toc != '0'"> + <xsl:call-template name="component.toc"/> + </xsl:if> + <xsl:apply-templates/> + <xsl:call-template name="process.footnotes"/> + </div> +</xsl:template> + +<xsl:template match="title" mode="appendix.titlepage.recto.mode"> + <xsl:call-template name="component.title"> + <xsl:with-param name="node" select="ancestor::appendix[1]"/> + </xsl:call-template> +</xsl:template> + +<xsl:template match="appendix/docinfo|appendixinfo"></xsl:template> +<xsl:template match="appendix/title"></xsl:template> +<xsl:template match="appendix/titleabbrev"></xsl:template> +<xsl:template match="appendix/subtitle"></xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="dedication" mode="component.number"> + <xsl:param name="add.space" select="false()"/> +</xsl:template> + +<xsl:template match="preface" mode="component.number"> + <xsl:param name="add.space" select="false()"/> +</xsl:template> + +<xsl:template match="chapter" mode="component.number"> + <xsl:param name="add.space" select="false()"/> + + <xsl:choose> + <xsl:when test="@label"> + <xsl:value-of select="@label"/> + <xsl:text>.</xsl:text> + <xsl:if test="$add.space"> + <xsl:call-template name="gentext.space"/> + </xsl:if> + </xsl:when> + <xsl:when test="$chapter.autolabel"> + <xsl:number from="book" count="chapter" format="1."/> + <xsl:if test="$add.space"> + <xsl:call-template name="gentext.space"/> + </xsl:if> + </xsl:when> + <xsl:otherwise></xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="appendix" mode="component.number"> + <xsl:param name="add.space" select="false()"/> + + <xsl:choose> + <xsl:when test="@label"> + <xsl:value-of select="@label"/> + <xsl:text>.</xsl:text> + <xsl:if test="$add.space"> + <xsl:call-template name="gentext.space"/> + </xsl:if> + </xsl:when> + <xsl:when test="$chapter.autolabel"> + <xsl:number from="book" count="appendix" format="A."/> + <xsl:if test="$add.space"> + <xsl:call-template name="gentext.space"/> + </xsl:if> + </xsl:when> + <xsl:otherwise></xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="article" mode="component.number"> + <xsl:param name="add.space" select="false()"/> +</xsl:template> + +<xsl:template match="bibliography" mode="component.number"> + <xsl:param name="add.space" select="false()"/> +</xsl:template> + +<xsl:template match="glossary" mode="component.number"> + <xsl:param name="add.space" select="false()"/> +</xsl:template> + +<xsl:template match="index" mode="component.number"> + <xsl:param name="add.space" select="false()"/> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="article"> + <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable> + <div id="{$id}" class="{name(.)}"> + <xsl:call-template name="article.titlepage"/> + <xsl:if test="$generate.article.toc != '0'"> + <xsl:call-template name="component.toc"/> + </xsl:if> + <xsl:apply-templates/> + <xsl:call-template name="process.footnotes"/> + </div> +</xsl:template> + +<xsl:template match="article/artheader|article/articleinfo"></xsl:template> +<xsl:template match="article/title"></xsl:template> +<xsl:template match="article/subtitle"></xsl:template> + +<xsl:template match="article/appendix"> + <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable> + + <div id="{$id}" class="{name(.)}"> + <xsl:call-template name="section.heading"> + <xsl:with-param name="level" select="2"/> + <xsl:with-param name="title"> + <xsl:apply-templates select="." mode="title.ref"/> + </xsl:with-param> + </xsl:call-template> + + <xsl:apply-templates/> + <xsl:if test="not(ancestor::article)"> + <xsl:call-template name="process.footnotes"/> + </xsl:if> + </div> +</xsl:template> + +<!-- ==================================================================== --> + +</xsl:stylesheet> + diff --git a/tests/docbook/html/division.xsl b/tests/docbook/html/division.xsl new file mode 100644 index 00000000..c7c29251 --- /dev/null +++ b/tests/docbook/html/division.xsl @@ -0,0 +1,130 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<!-- ==================================================================== --> + +<xsl:template match="set"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + + <div class="{name(.)}" id="{$id}"> + <xsl:call-template name="set.titlepage"/> + <xsl:if test="$generate.set.toc != '0'"> + <xsl:call-template name="set.toc"/> + </xsl:if> + <xsl:apply-templates/> + </div> +</xsl:template> + +<xsl:template match="set/setinfo"></xsl:template> +<xsl:template match="set/title"></xsl:template> +<xsl:template match="set/subtitle"></xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="book"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + + <div class="{name(.)}" id="{$id}"> + <xsl:call-template name="book.titlepage"/> + <xsl:apply-templates select="dedication" mode="dedication"/> + <xsl:if test="$generate.book.toc != '0'"> + <xsl:call-template name="division.toc"/> + </xsl:if> + <xsl:apply-templates/> + </div> +</xsl:template> + +<xsl:template match="book/bookinfo"></xsl:template> +<xsl:template match="book/title"></xsl:template> +<xsl:template match="book/subtitle"></xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="part"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + + <div class="{name(.)}" id="{$id}"> + <xsl:call-template name="part.titlepage"/> + <xsl:if test="not(partintro) and $generate.part.toc != '0'"> + <xsl:call-template name="division.toc"/> + </xsl:if> + <xsl:apply-templates/> + </div> +</xsl:template> + +<xsl:template match="part" mode="make.part.toc"> + <xsl:call-template name="division.toc"/> +</xsl:template> + +<xsl:template match="reference" mode="make.part.toc"> + <xsl:call-template name="division.toc"/> +</xsl:template> + +<xsl:template match="part/docinfo"></xsl:template> +<xsl:template match="part/title"></xsl:template> +<xsl:template match="part/subtitle"></xsl:template> + +<xsl:template match="partintro"> + <div class="{name(.)}"> + <xsl:call-template name="partintro.titlepage"/> + <xsl:apply-templates/> + <xsl:if test="$generate.part.toc != '0'"> + <!-- not ancestor::part because partintro appears in reference --> + <xsl:apply-templates select="parent::*" mode="make.part.toc"/> + </xsl:if> + <xsl:call-template name="process.footnotes"/> + </div> +</xsl:template> + +<xsl:template match="partintro/title"></xsl:template> +<xsl:template match="partintro/subtitle"></xsl:template> +<xsl:template match="partintro/titleabbrev"></xsl:template> + +<xsl:template match="partintro/title" mode="partintro.title.mode"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select=".."/> + </xsl:call-template> + </xsl:variable> + <h2> + <a name="{$id}"> + <xsl:apply-templates/> + </a> + </h2> +</xsl:template> + +<xsl:template match="partintro/subtitle" mode="partintro.title.mode"> + <h3> + <i><xsl:apply-templates/></i> + </h3> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="book" mode="division.number"> + <xsl:number from="set" count="book" format="1."/> +</xsl:template> + +<xsl:template match="part" mode="division.number"> + <xsl:number from="book" count="part" format="I."/> +</xsl:template> + +</xsl:stylesheet> + diff --git a/tests/docbook/html/docbook.xsl b/tests/docbook/html/docbook.xsl new file mode 100644 index 00000000..73e64954 --- /dev/null +++ b/tests/docbook/html/docbook.xsl @@ -0,0 +1,190 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" + exclude-result-prefixes="doc" + version='1.0'> + +<xsl:output method="html" + encoding="ISO-8859-1" + indent="no"/> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<!-- ==================================================================== --> + +<xsl:include href="../VERSION"/> +<xsl:include href="../lib/lib.xsl"/> +<xsl:include href="../common/l10n.xsl"/> +<xsl:include href="../common/common.xsl"/> +<xsl:include href="autotoc.xsl"/> +<xsl:include href="lists.xsl"/> +<xsl:include href="callout.xsl"/> +<xsl:include href="verbatim.xsl"/> +<xsl:include href="graphics.xsl"/> +<xsl:include href="xref.xsl"/> +<xsl:include href="formal.xsl"/> +<xsl:include href="table.xsl"/> +<xsl:include href="sections.xsl"/> +<xsl:include href="inline.xsl"/> +<xsl:include href="footnote.xsl"/> +<xsl:include href="html.xsl"/> +<xsl:include href="info.xsl"/> +<xsl:include href="keywords.xsl"/> +<xsl:include href="division.xsl"/> +<xsl:include href="toc.xsl"/> +<xsl:include href="index.xsl"/> +<xsl:include href="refentry.xsl"/> +<xsl:include href="math.xsl"/> +<xsl:include href="admon.xsl"/> +<xsl:include href="component.xsl"/> +<xsl:include href="biblio.xsl"/> +<xsl:include href="glossary.xsl"/> +<xsl:include href="block.xsl"/> +<xsl:include href="qandaset.xsl"/> +<xsl:include href="synop.xsl"/> +<xsl:include href="titlepage.xsl"/> +<xsl:include href="titlepage.templates.xsl"/> +<xsl:include href="param.xsl"/> +<xsl:include href="pi.xsl"/> + +<!-- ==================================================================== --> + +<xsl:template match="*"> + <xsl:message> + <xsl:text>No template matches </xsl:text> + <xsl:value-of select="name(.)"/> + <xsl:text>.</xsl:text> + </xsl:message> + + <font color="red"> + <xsl:text><</xsl:text> + <xsl:value-of select="name(.)"/> + <xsl:text>></xsl:text> + <xsl:apply-templates/> + <xsl:text></</xsl:text> + <xsl:value-of select="name(.)"/> + <xsl:text>></xsl:text> + </font> +</xsl:template> + +<xsl:template match="text()"> + <xsl:value-of select="."/> +</xsl:template> + +<xsl:template name="head.content"> + <xsl:param name="node" select="."/> + <xsl:variable name="info" select="($node/docinfo + |$node/chapterinfo + |$node/appendixinfo + |$node/prefaceinfo + |$node/bookinfo + |$node/setinfo + |$node/articleinfo + |$node/artheader + |$node/sect1info + |$node/sect2info + |$node/sect3info + |$node/sect4info + |$node/sect5info + |$node/refsect1info + |$node/refsect2info + |$node/refsect3info + |$node/bibliographyinfo + |$node/glossaryinfo + |$node/indexinfo + |$node/refentryinfo + |$node/partinfo + |$node/referenceinfo)[1]"/> + + <title> + <xsl:apply-templates select="$node" mode="title.ref"> + <xsl:with-param name="text-only" select="'1'"/> + </xsl:apply-templates> + </title> + + <xsl:if test="$html.stylesheet"> + <link rel="stylesheet" + href="{$html.stylesheet}" + type="{$html.stylesheet.type}"/> + </xsl:if> + + <xsl:if test="$link.mailto.url != ''"> + <link rev="made" + href="{$link.mailto.url}"/> + </xsl:if> + + <xsl:if test="$html.base != ''"> + <base href="{$html.base}"/> + </xsl:if> + + <meta name="generator" content="DocBook XSL Stylesheets V{$VERSION}"/> + + <xsl:apply-templates select="$info/keywordset" mode="html.header"/> +</xsl:template> + +<xsl:template name="user.head.content"> + <xsl:param name="node" select="."/> +</xsl:template> + +<xsl:template name="user.header.content"> + <xsl:param name="node" select="."/> +</xsl:template> + +<xsl:template name="user.footer.content"> + <xsl:param name="node" select="."/> +</xsl:template> + +<xsl:template match="/"> + <xsl:choose> + <xsl:when test="$rootid != ''"> + <xsl:choose> + <xsl:when test="count(id($rootid)) = 0"> + <xsl:message terminate="yes"> + <xsl:text>ID '</xsl:text> + <xsl:value-of select="$rootid"/> + <xsl:text>' not found in document.</xsl:text> + </xsl:message> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="id($rootid)" mode="process.root"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="/" mode="process.root"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="*" mode="process.root"> + <xsl:variable name="doc" select="self::*"/> + <html> + <head> + <xsl:call-template name="head.content"> + <xsl:with-param name="node" select="$doc"/> + </xsl:call-template> + <xsl:call-template name="user.head.content"/> + </head> + <body xsl:use-attribute-sets="body.attrs"> + <xsl:call-template name="user.header.content"> + <xsl:with-param name="node" select="$doc"/> + </xsl:call-template> + <xsl:apply-templates select="."/> + <xsl:call-template name="user.footer.content"> + <xsl:with-param name="node" select="$doc"/> + </xsl:call-template> + </body> + </html> +</xsl:template> + +<!-- ==================================================================== --> + +</xsl:stylesheet> diff --git a/tests/docbook/html/ebnf.xsl b/tests/docbook/html/ebnf.xsl new file mode 100644 index 00000000..2bcb200f --- /dev/null +++ b/tests/docbook/html/ebnf.xsl @@ -0,0 +1,350 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" + exclude-result-prefixes="doc" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<doc:reference xmlns=""> +<referenceinfo> +<releaseinfo role="meta"> +$Id$ +</releaseinfo> +<author><surname>Walsh</surname> +<firstname>Norman</firstname></author> +<copyright><year>1999</year><year>2000</year> +<holder>Norman Walsh</holder> +</copyright> +</referenceinfo> +<title>HTML EBNF Reference</title> + +<partintro> +<section><title>Introduction</title> + +<para>This is technical reference documentation for the DocBook XSL +Stylesheets; it documents (some of) the parameters, templates, and +other elements of the stylesheets.</para> + +<para>This reference describes the templates and parameters relevant +to formatting EBNF markup.</para> + +<para>This is not intended to be <quote>user</quote> documentation. +It is provided for developers writing customization layers for the +stylesheets, and for anyone who's interested in <quote>how it +works</quote>.</para> + +<para>Although I am trying to be thorough, this documentation is known +to be incomplete. Don't forget to read the source, too :-)</para> +</section> +</partintro> +</doc:reference> + +<!-- This module formats EBNF tables. The DTD that this supports is --> +<!-- under development by the DocBook community. This code is --> +<!-- experimental and is not (yet) part of the DocBook stylesheets. --> + +<xsl:include href="docbook.xsl"/> + +<!-- ==================================================================== --> + +<xsl:param name="ebnf.table.bgcolor">#F5DCB3</xsl:param> + +<doc:param name="ebnf.table.bgcolor" xmlns=""> +<refpurpose>Background color for EBNF tables</refpurpose> +<refdescription> +<para>Sets the background color for EBNF tables. No <sgmltag>bgcolor</sgmltag> +attribute is output if <varname>ebnf.table.bgcolor</varname> is set to +the null string. The default value matches the value used in recent +online versions of the W3C's XML Spec productions.</para> +</refdescription> +</doc:param> + +<xsl:param name="ebnf.table.border">1</xsl:param> + +<doc:param name="ebnf.table.border" xmlns=""> +<refpurpose>Selects border on EBNF tables</refpurpose> +<refdescription> +<para>Selects the border on EBNF tables. If non-zero, the tables have +borders, otherwise they don't.</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> + +<xsl:template match="productionset"> + <table width="100%" cellpadding="5"> + <xsl:if test="$ebnf.table.bgcolor != ''"> + <xsl:attribute name="bgcolor"> + <xsl:value-of select="$ebnf.table.bgcolor"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="$ebnf.table.border != 0"> + <xsl:attribute name="border">1</xsl:attribute> + </xsl:if> + <xsl:attribute name="class"> + <xsl:value-of select="name(.)"/> + </xsl:attribute> + <xsl:attribute name="summary"> + <xsl:text>EBNF</xsl:text> + <xsl:if test="title"> + <xsl:text> for </xsl:text> + <xsl:value-of select="title"/> + </xsl:if> + </xsl:attribute> + + <xsl:if test="title"> + <tr> + <th align="left" valign="top" class="{name(.)}"> + <xsl:apply-templates select="title"/> + </th> + </tr> + </xsl:if> + <tr> + <td> + <table border="0" width="99%" cellpadding="0"> + <xsl:if test="$ebnf.table.bgcolor != ''"> + <xsl:attribute name="bgcolor"> + <xsl:value-of select="$ebnf.table.bgcolor"/> + </xsl:attribute> + </xsl:if> + <xsl:attribute name="class"> + <xsl:value-of select="name(.)"/> + </xsl:attribute> + <xsl:attribute name="summary">EBNF productions</xsl:attribute> + <xsl:apply-templates select="production|productionrecap"/> + </table> + </td> + </tr> + </table> +</xsl:template> + +<xsl:template match="productionset/title"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="production"> + <xsl:param name="recap" select="false()"/> + <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable> + <tr> + <td align="left" valign="top" width="3%"> + <xsl:text>[</xsl:text> + <xsl:number count="production" level="any"/> + <xsl:text>]</xsl:text> + </td> + <td align="right" valign="top" width="10%"> + <xsl:choose> + <xsl:when test="$recap"> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="."/> + </xsl:call-template> + </xsl:attribute> + <xsl:apply-templates select="lhs"/> + </a> + </xsl:when> + <xsl:otherwise> + <a name="{$id}"/> + <xsl:apply-templates select="lhs"/> + </xsl:otherwise> + </xsl:choose> + </td> + <td valign="top" width="5%" align="center"><tt>::=</tt></td> + <td valign="top" width="52%"> + <xsl:apply-templates select="rhs"/> + </td> + <td align="left" valign="top" width="30%"> + <xsl:choose> + <xsl:when test="rhs/lineannotation|constraint"> + <xsl:apply-templates select="rhs/lineannotation" mode="rhslo"/> + <xsl:apply-templates select="constraint"/> + </xsl:when> + <xsl:otherwise> + <xsl:text> </xsl:text> + </xsl:otherwise> + </xsl:choose> + </td> + </tr> +</xsl:template> + +<xsl:template match="productionrecap"> + <xsl:variable name="targets" select="id(@linkend)"/> + <xsl:variable name="target" select="$targets[1]"/> + + <xsl:if test="$check.idref = '1'"> + <xsl:if test="count($targets)=0"> + <xsl:message> + <xsl:text>Error: no ID for productionrecap linkend: </xsl:text> + <xsl:value-of select="@linkend"/> + <xsl:text>.</xsl:text> + </xsl:message> + </xsl:if> + + <xsl:if test="count($targets)>1"> + <xsl:message> + <xsl:text>Warning: multiple "IDs" for productionrecap linkend: </xsl:text> + <xsl:value-of select="@linkend"/> + <xsl:text>.</xsl:text> + </xsl:message> + </xsl:if> + </xsl:if> + <xsl:apply-templates select="$target"> + <xsl:with-param name="recap" select="true()"/> + </xsl:apply-templates> +</xsl:template> + +<xsl:template match="lhs"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="rhs"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="nonterminal"> + <xsl:variable name="linkend"> + <xsl:call-template name="xpointer.idref"> + <xsl:with-param name="xpointer" select="@def"/> + </xsl:call-template> + </xsl:variable> + + <xsl:call-template name="check.id.unique"> + <xsl:with-param name="linkend" select="$linkend"/> + </xsl:call-template> + + <xsl:call-template name="check.idref.targets"> + <xsl:with-param name="linkend" select="$linkend"/> + <xsl:with-param name="element-list">production</xsl:with-param> + </xsl:call-template> + + <!-- If you don't provide content, you can't point outside this doc. --> + <xsl:choose> + <xsl:when test="*|text()"><!--nop--></xsl:when> + <xsl:otherwise> + <xsl:if test="$linkend = ''"> + <xsl:message> + <xsl:text>Non-terminals with no content must point to </xsl:text> + <xsl:text>production elements in the current document.</xsl:text> + </xsl:message> + <xsl:message> + <xsl:text>Invalid xpointer for empty nt: </xsl:text> + <xsl:value-of select="@def"/> + </xsl:message> + </xsl:if> + </xsl:otherwise> + </xsl:choose> + + <xsl:variable name="href"> + <xsl:choose> + <xsl:when test="$linkend != ''"> + <xsl:variable name="targets" select="id($linkend)"/> + <xsl:variable name="target" select="$targets[1]"/> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$target"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="@def"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <a href="{$href}"> + <xsl:choose> + <xsl:when test="*|text()"> + <xsl:apply-templates/> + </xsl:when> + <xsl:otherwise> + <xsl:choose> + <xsl:when test="$linkend != ''"> + <xsl:variable name="targets" select="id($linkend)"/> + <xsl:variable name="target" select="$targets[1]"/> + <xsl:apply-templates select="$target/lhs"/> + </xsl:when> + <xsl:otherwise> + <xsl:text>???</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> + </a> +</xsl:template> + +<xsl:template match="rhs/lineannotation"> + <!--nop--> +</xsl:template> + +<xsl:template match="rhs/lineannotation" mode="rhslo"> + <xsl:text>/* </xsl:text> + <xsl:apply-templates/> + <xsl:text> */</xsl:text> +</xsl:template> + +<xsl:template match="constraint"> + <xsl:call-template name="check.id.unique"> + <xsl:with-param name="linkend" select="@linkend"/> + </xsl:call-template> + + <xsl:call-template name="check.idref.targets"> + <xsl:with-param name="linkend" select="@linkend"/> + <xsl:with-param name="element-list">constraintdef</xsl:with-param> + </xsl:call-template> + + <xsl:variable name="href"> + <xsl:variable name="targets" select="id(@linkend)"/> + <xsl:variable name="target" select="$targets[1]"/> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$target"/> + </xsl:call-template> + </xsl:variable> + + <xsl:if test="preceding-sibling::constraint"> + <br/> + </xsl:if> + <xsl:text>[ </xsl:text> + + <xsl:choose> + <xsl:when test="@role"> + <xsl:value-of select="@role"/> + <xsl:text>: </xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="targets" select="id(@linkend)"/> + <xsl:variable name="target" select="$targets[1]"/> + <xsl:if test="$target/@role"> + <xsl:value-of select="$target/@role"/> + <xsl:text>: </xsl:text> + </xsl:if> + </xsl:otherwise> + </xsl:choose> + + <a href="{$href}"> + <xsl:variable name="targets" select="id(@linkend)"/> + <xsl:variable name="target" select="$targets[1]"/> + <xsl:apply-templates select="$target" mode="title.content"/> + </a> + <xsl:text> ]</xsl:text> +</xsl:template> + +<xsl:template match="constraintdef"> + <div class="{name(.)}"> + <xsl:apply-templates/> + </div> +</xsl:template> + +<xsl:template match="constraintdef/title"> + <p><b><xsl:apply-templates/></b></p> +</xsl:template> + +<!-- ==================================================================== --> + +</xsl:stylesheet> diff --git a/tests/docbook/html/footnote.xsl b/tests/docbook/html/footnote.xsl new file mode 100644 index 00000000..a5c7ec7d --- /dev/null +++ b/tests/docbook/html/footnote.xsl @@ -0,0 +1,138 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<xsl:template match="footnote"> + <xsl:variable name="name"> + <xsl:call-template name="object.id"/> + </xsl:variable> + <xsl:variable name="href"> + <xsl:text>#ftn.</xsl:text> + <xsl:call-template name="object.id"/> + </xsl:variable> + + <xsl:choose> + <xsl:when test="ancestor::table|ancestor::informaltable"> + <sup> + <xsl:text>[</xsl:text> + <a name="{$name}" href="{$href}"> + <xsl:apply-templates select="." mode="footnote.number"/> + </a> + <xsl:text>]</xsl:text> + </sup> + </xsl:when> + <xsl:otherwise> + <sup> + <xsl:text>[</xsl:text> + <a name="{$name}" href="{$href}"> + <xsl:apply-templates select="." mode="footnote.number"/> + </a> + <xsl:text>]</xsl:text> + </sup> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="footnoteref"> + <xsl:variable name="targets" select="id(@linkend)"/> + <xsl:variable name="footnote" select="$targets[1]"/> + <xsl:variable name="href"> + <xsl:text>#ftn.</xsl:text> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select="$footnote"/> + </xsl:call-template> + </xsl:variable> + <sup> + <xsl:text>[</xsl:text> + <a href="{$href}"> + <xsl:apply-templates select="$footnote" mode="footnote.number"/> + </a> + <xsl:text>]</xsl:text> + </sup> +</xsl:template> + +<xsl:template match="footnote" mode="footnote.number"> + <xsl:choose> + <xsl:when test="ancestor::table|ancestor::informaltable"> + <xsl:number level="any" from="table|informaltable" format="a"/> + </xsl:when> + <xsl:otherwise> + <xsl:number level="any" format="1"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="footnote/para[1]"> + <!-- this only works if the first thing in a footnote is a para, --> + <!-- which is ok, because it usually is. --> + <xsl:variable name="name"> + <xsl:text>ftn.</xsl:text> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select="ancestor::footnote"/> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="href"> + <xsl:text>#</xsl:text> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select="ancestor::footnote"/> + </xsl:call-template> + </xsl:variable> + <p> + <sup> + <xsl:text>[</xsl:text> + <a name="{$name}" href="{$href}"> + <xsl:apply-templates select="ancestor::footnote" + mode="footnote.number"/> + </a> + <xsl:text>] </xsl:text> + </sup> + <xsl:apply-templates/> + </p> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template name="process.footnotes"> + <xsl:variable name="footnotes" select=".//footnote"/> + <xsl:variable name="table.footnotes" + select=".//table//footnote|.//informaltable//footnote"/> + + <!-- Only bother to do this if there's at least one non-table footnote --> + <xsl:if test="count($footnotes)>count($table.footnotes)"> + <div class="footnotes"> + <br/> + <hr width="100" align="left"/> + <xsl:apply-templates select="$footnotes" mode="process.footnote.mode"/> + </div> + </xsl:if> +</xsl:template> + +<xsl:template match="footnote" mode="process.footnote.mode"> + <div class="{name(.)}"> + <xsl:apply-templates/> + </div> +</xsl:template> + +<xsl:template match="informaltable//footnote|table//footnote" + mode="process.footnote.mode"> +</xsl:template> + +<xsl:template match="footnote" mode="table.footnote.mode"> + <div class="{name(.)}"> + <xsl:apply-templates/> + </div> +</xsl:template> + +</xsl:stylesheet> diff --git a/tests/docbook/html/formal.xsl b/tests/docbook/html/formal.xsl new file mode 100644 index 00000000..d0f8fec9 --- /dev/null +++ b/tests/docbook/html/formal.xsl @@ -0,0 +1,89 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<xsl:template name="formal.object"> + <div class="{name(.)}"> + <xsl:call-template name="formal.object.heading"> + <xsl:with-param name="title"> + <xsl:apply-templates select="." mode="title.ref"/> + </xsl:with-param> + </xsl:call-template> + <xsl:apply-templates/> + </div> +</xsl:template> + +<xsl:template name="formal.object.heading"> + <xsl:param name="title"></xsl:param> + <p> + <a> + <xsl:attribute name="name"> + <xsl:call-template name="object.id"/> + </xsl:attribute> + </a> + <b><xsl:copy-of select="$title"/></b> + </p> +</xsl:template> + +<xsl:template name="informal.object"> + <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable> + + <div class="{name(.)}" id="{$id}"> + <xsl:if test="$spacing.paras != 0"><p/></xsl:if> + <a name="{$id}"/> + <xsl:apply-templates/> + <xsl:if test="$spacing.paras != 0"><p/></xsl:if> + </div> +</xsl:template> + +<xsl:template name="semiformal.object"> + <xsl:choose> + <xsl:when test="title"> + <xsl:call-template name="formal.object"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="informal.object"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="figure|table|example"> + <xsl:call-template name="formal.object"/> +</xsl:template> + +<xsl:template match="equation"> + <xsl:call-template name="semiformal.object"/> +</xsl:template> + +<xsl:template match="figure/title"></xsl:template> +<xsl:template match="table/title"></xsl:template> +<xsl:template match="example/title"></xsl:template> +<xsl:template match="equation/title"></xsl:template> + +<xsl:template match="informalfigure"> + <xsl:call-template name="informal.object"/> +</xsl:template> + +<xsl:template match="informalexample"> + <xsl:call-template name="informal.object"/> +</xsl:template> + +<xsl:template match="informaltable"> + <xsl:call-template name="informal.object"/> +</xsl:template> + +<xsl:template match="informalequation"> + <xsl:call-template name="informal.object"/> +</xsl:template> + +</xsl:stylesheet> diff --git a/tests/docbook/html/glossary.xsl b/tests/docbook/html/glossary.xsl new file mode 100644 index 00000000..1885f845 --- /dev/null +++ b/tests/docbook/html/glossary.xsl @@ -0,0 +1,198 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<!-- ==================================================================== --> + +<xsl:template match="glossary"> + <div class="{name(.)}"> + <xsl:call-template name="component.separator"/> + <xsl:choose> + <xsl:when test="./title"> + <xsl:apply-templates select="./title" mode="component.title.mode"/> + </xsl:when> + <xsl:otherwise> + <h2 class="title"> + <a> + <xsl:attribute name="name"> + <xsl:call-template name="object.id"/> + </xsl:attribute> + </a> + <xsl:call-template name="gentext.element.name"/> + </h2> + </xsl:otherwise> + </xsl:choose> + + <xsl:if test="./subtitle"> + <xsl:apply-templates select="./subtitle" mode="component.title.mode"/> + </xsl:if> + + <dl> + <xsl:apply-templates/> + </dl> + + <xsl:call-template name="process.footnotes"/> + </div> +</xsl:template> + +<xsl:template match="glossary/glossaryinfo"></xsl:template> +<xsl:template match="glossary/title"></xsl:template> +<xsl:template match="glossary/subtitle"></xsl:template> +<xsl:template match="glossary/titleabbrev"></xsl:template> + +<xsl:template match="glossary/title" mode="component.title.mode"> + <h2> + <xsl:apply-templates/> + </h2> +</xsl:template> + +<xsl:template match="glossary/subtitle" mode="component.title.mode"> + <h3> + <i><xsl:apply-templates/></i> + </h3> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="glosslist"> + <div class="{name(.)}"> + <a> + <xsl:attribute name="name"> + <xsl:call-template name="object.id"/> + </xsl:attribute> + </a> + + <dl> + <xsl:apply-templates/> + </dl> + </div> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="glossdiv"> + <div class="{name(.)}"> + <xsl:apply-templates/> + </div> +</xsl:template> + +<xsl:template match="glossdiv/title"> + <h3 class="{name(.)}"> + <xsl:apply-templates/> + </h3> +</xsl:template> + +<!-- ==================================================================== --> + +<!-- +GlossEntry ::= + GlossTerm, Acronym?, Abbrev?, + (IndexTerm)*, + RevHistory?, + (GlossSee | GlossDef+) +--> + +<xsl:template match="glossentry"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="glossentry/glossterm"> + <dt> + <xsl:apply-templates/> + </dt> +</xsl:template> + +<xsl:template match="glossentry/glossterm[1]" priority="2"> + <dt> + <a> + <xsl:attribute name="name"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select=".."/> + </xsl:call-template> + </xsl:attribute> + + <xsl:apply-templates/> + </a> + </dt> +</xsl:template> + +<xsl:template match="glossentry/acronym"> +</xsl:template> + +<xsl:template match="glossentry/abbrev"> +</xsl:template> + +<xsl:template match="glossentry/revhistory"> +</xsl:template> + +<xsl:template match="glossentry/glosssee"> + <xsl:variable name="otherterm" select="@otherterm"/> + <xsl:variable name="targets" select="//node()[@id=$otherterm]"/> + <xsl:variable name="target" select="$targets[1]"/> + <dd> + <p> + <xsl:call-template name="gentext.element.name"/> + <xsl:call-template name="gentext.space"/> + <xsl:choose> + <xsl:when test="@otherterm"> + <a href="#{@otherterm}"> + <xsl:apply-templates select="$target" mode="xref"/> + </a> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> + <xsl:text>.</xsl:text> + </p> + </dd> +</xsl:template> + +<xsl:template match="glossentry/glossdef"> + <dd><xsl:apply-templates/></dd> +</xsl:template> + +<xsl:template match="glossseealso"> + <xsl:variable name="otherterm" select="@otherterm"/> + <xsl:variable name="targets" select="//node()[@id=$otherterm]"/> + <xsl:variable name="target" select="$targets[1]"/> + <p> + <xsl:call-template name="gentext.element.name"/> + <xsl:call-template name="gentext.space"/> + <xsl:choose> + <xsl:when test="@otherterm"> + <a href="#{@otherterm}"> + <xsl:apply-templates select="$target" mode="xref"/> + </a> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> + <xsl:text>.</xsl:text> + </p> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="glossentry" mode="xref"> + <xsl:apply-templates select="./glossterm[1]" mode="xref"/> +</xsl:template> + +<xsl:template match="glossterm" mode="xref"> + <xsl:apply-templates/> +</xsl:template> + +<!-- ==================================================================== --> + +</xsl:stylesheet> diff --git a/tests/docbook/html/graphics.xsl b/tests/docbook/html/graphics.xsl new file mode 100644 index 00000000..e30af9d7 --- /dev/null +++ b/tests/docbook/html/graphics.xsl @@ -0,0 +1,315 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:text5="http://nwalsh.com/com.nwalsh.saxon.TextFactory" + xmlns:text6="http://nwalsh.com/com.nwalsh.saxon6.TextFactory" + exclude-result-prefixes="xlink text5 text6" + extension-element-prefixes="text5 text6" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + Contributors: + Colin Paul Adams, <colin@colina.demon.co.uk> + + ******************************************************************** --> + +<!-- ==================================================================== --> + +<xsl:template match="screenshot"> + <div class="{name(.)}"> + <xsl:apply-templates/> + </div> +</xsl:template> + +<xsl:template match="screeninfo"> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template name="process.image"> + <!-- When this template is called, the current node should be --> + <!-- a graphic, inlinegraphic, imagedata, or videodata. All --> + <!-- those elements have the same set of attributes, so we can --> + <!-- handle them all in one place. --> + <xsl:param name="tag" select="'img'"/> + <xsl:param name="alt"/> + + <xsl:variable name="filename"> + <xsl:choose> + <xsl:when test="local-name(.) = 'graphic' + or local-name(.) = 'inlinegraphic'"> + <xsl:choose> + <xsl:when test="@fileref"> + <xsl:value-of select="@fileref"/> + </xsl:when> + <xsl:when test="@entityref"> + <xsl:value-of select="unparsed-entity-uri(@entityref)"/> + </xsl:when> + <xsl:otherwise> + <xsl:message> + <xsl:text>A fileref or entityref is required on </xsl:text> + <xsl:value-of select="local-name(.)"/> + </xsl:message> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <!-- imagedata, videodata, audiodata --> + <xsl:call-template name="mediaobject.filename"> + <xsl:with-param name="object" select=".."/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="width"> + <xsl:choose> + <xsl:when test="@scale"><xsl:value-of select="@scale"/>%</xsl:when> + <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when> + <xsl:otherwise></xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="height"> + <xsl:choose> + <xsl:when test="@scale"></xsl:when> + <xsl:when test="@depth"><xsl:value-of select="@depth"/></xsl:when> + <xsl:otherwise></xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="align"> + <xsl:value-of select="@align"/> + </xsl:variable> + + <xsl:element name="{$tag}"> + <xsl:attribute name="src"> + <xsl:value-of select="$filename"/> + </xsl:attribute> + + <xsl:if test="$align != ''"> + <xsl:attribute name="align"> + <xsl:value-of select="$align"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="$height != ''"> + <xsl:attribute name="height"> + <xsl:value-of select="$height"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="$width != ''"> + <xsl:attribute name="width"> + <xsl:value-of select="$width"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="$alt != ''"> + <xsl:attribute name="alt"> + <xsl:value-of select="$alt"/> + </xsl:attribute> + </xsl:if> + </xsl:element> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="graphic"> + <p> + <xsl:call-template name="process.image"/> + </p> +</xsl:template> + +<xsl:template match="inlinegraphic"> + <xsl:variable name="vendor" select="system-property('xsl:vendor')"/> + <xsl:choose> + <xsl:when test="@format='linespecific'"> + <xsl:choose> + <xsl:when test="$saxon.extensions != '0' + and $saxon.textinsert != '0'"> + <xsl:choose> + <xsl:when test="@entityref"> + <xsl:choose> + <xsl:when test="contains($vendor, 'SAXON 6')"> + <text6:insertfile href="{unparsed-entity-uri(@entityref)}"/> + </xsl:when> + <xsl:otherwise> + <text5:insertfile href="{unparsed-entity-uri(@entityref)}"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:choose> + <xsl:when test="contains($vendor, 'SAXON 6')"> + <text6:insertfile href="{@fileref}"/> + </xsl:when> + <xsl:otherwise> + <text5:insertfile href="{@fileref}"/> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <a xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"> + <xsl:choose> + <xsl:when test="@entityref"> + <xsl:attribute name="href"> + <xsl:value-of select="unparsed-entity-uri(@entityref)"/> + </xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:attribute name="href"> + <xsl:value-of select="@fileref"/> + </xsl:attribute> + </xsl:otherwise> + </xsl:choose> + </a> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="process.image"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="mediaobject|mediaobjectco"> + <div class="{name(.)}"> + <xsl:call-template name="select.mediaobject"/> + <xsl:apply-templates select="caption"/> + </div> +</xsl:template> + +<xsl:template match="inlinemediaobject"> + <span class="{name(.)}"> + <xsl:call-template name="select.mediaobject"/> + </span> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="imageobjectco"> + <xsl:apply-templates select="imageobject"/> +</xsl:template> + +<xsl:template match="imageobject"> + <xsl:apply-templates select="imagedata"/> +</xsl:template> + +<xsl:template match="imagedata"> + <xsl:variable name="vendor" select="system-property('xsl:vendor')"/> + <xsl:variable name="filename"> + <xsl:call-template name="mediaobject.filename"> + <xsl:with-param name="object" select=".."/> + </xsl:call-template> + </xsl:variable> + + <xsl:choose> + <xsl:when test="@format='linespecific'"> + <xsl:choose> + <xsl:when test="$saxon.extensions != '0' + and $saxon.textinsert != '0'"> + <xsl:choose> + <xsl:when test="@entityref"> + <xsl:choose> + <xsl:when test="contains($vendor, 'SAXON 6')"> + <text6:insertfile href="{unparsed-entity-uri(@entityref)}"/> + </xsl:when> + <xsl:otherwise> + <text5:insertfile href="{unparsed-entity-uri(@entityref)}"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:choose> + <xsl:when test="contains($vendor, 'SAXON 6')"> + <text6:insertfile href="{@fileref}"/> + </xsl:when> + <xsl:otherwise> + <text5:insertfile href="{@fileref}"/> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <a xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"> + <xsl:choose> + <xsl:when test="@entityref"> + <xsl:attribute name="href"> + <xsl:value-of select="unparsed-entity-uri(@entityref)"/> + </xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:attribute name="href"> + <xsl:value-of select="@fileref"/> + </xsl:attribute> + </xsl:otherwise> + </xsl:choose> + </a> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="process.image"> + <xsl:with-param name="alt"> + <xsl:apply-templates select="(../../textobject/phrase)[1]"/> + </xsl:with-param> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="videoobject"> + <xsl:apply-templates select="videodata"/> +</xsl:template> + +<xsl:template match="videodata"> + <xsl:call-template name="process.image"> + <xsl:with-param name="tag" select="'embed'"/> + <xsl:with-param name="alt"> + <xsl:apply-templates select="(../../textobject/phrase)[1]"/> + </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="audioobject"> + <xsl:apply-templates select="audiodata"/> +</xsl:template> + +<xsl:template match="audiodata"> + <xsl:call-template name="process.image"> + <xsl:with-param name="tag" select="'embed'"/> + <xsl:with-param name="alt"> + <xsl:apply-templates select="(../../textobject/phrase)[1]"/> + </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="textobject"> + <xsl:apply-templates/> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="caption"> + <div class="{name(.)}"> + <xsl:apply-templates/> + </div> +</xsl:template> + +</xsl:stylesheet> diff --git a/tests/docbook/html/html.xsl b/tests/docbook/html/html.xsl new file mode 100644 index 00000000..839c8ac6 --- /dev/null +++ b/tests/docbook/html/html.xsl @@ -0,0 +1,56 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<xsl:template name="dingbat"> + <xsl:param name="dingbat">bullet</xsl:param> + <xsl:choose> + <xsl:when test="false() and $using.chunker != 0"> + <dingbat name="{$dingbat}"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="dingbat.characters"> + <xsl:with-param name="dingbat" select="$dingbat"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="dingbat.characters"> + <!-- now that I'm using the real serializer, all that dingbat malarky --> + <!-- isn't necessary anymore... --> + <xsl:param name="dingbat">bullet</xsl:param> + <xsl:choose> + <xsl:when test="$dingbat='bullet'">•</xsl:when> + <xsl:when test="$dingbat='copyright'">©</xsl:when> + <xsl:when test="$dingbat='trademark'">™</xsl:when> + <xsl:when test="$dingbat='trade'">™</xsl:when> + <xsl:when test="$dingbat='registered'">®</xsl:when> + <xsl:when test="$dingbat='service'">(SM)</xsl:when> + <xsl:when test="$dingbat='nbsp'"> </xsl:when> + <xsl:when test="$dingbat='ldquo'">“</xsl:when> + <xsl:when test="$dingbat='rdquo'">”</xsl:when> + <xsl:when test="$dingbat='lsquo'">‘</xsl:when> + <xsl:when test="$dingbat='rsquo'">’</xsl:when> + <xsl:when test="$dingbat='em-dash'">—</xsl:when> + <xsl:when test="$dingbat='mdash'">—</xsl:when> + <xsl:when test="$dingbat='en-dash'">–</xsl:when> + <xsl:when test="$dingbat='ndash'">–</xsl:when> + <xsl:otherwise> + <xsl:text>•</xsl:text> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +</xsl:stylesheet> + diff --git a/tests/docbook/html/index.xsl b/tests/docbook/html/index.xsl new file mode 100644 index 00000000..183d5063 --- /dev/null +++ b/tests/docbook/html/index.xsl @@ -0,0 +1,478 @@ +<?xml version='1.0'?> +<!DOCTYPE xsl:stylesheet [ + +<!ENTITY primary 'concat(primary/@sortas, primary[not(@sortas)])'> +<!ENTITY secondary 'concat(secondary/@sortas, secondary[not(@sortas)])'> +<!ENTITY tertiary 'concat(tertiary/@sortas, tertiary[not(@sortas)])'> + +<!ENTITY section '(ancestor-or-self::set + |ancestor-or-self::book + |ancestor-or-self::part + |ancestor-or-self::reference + |ancestor-or-self::partintro + |ancestor-or-self::chapter + |ancestor-or-self::appendix + |ancestor-or-self::preface + |ancestor-or-self::section + |ancestor-or-self::sect1 + |ancestor-or-self::sect2 + |ancestor-or-self::sect3 + |ancestor-or-self::sect4 + |ancestor-or-self::sect5 + |ancestor-or-self::refsect1 + |ancestor-or-self::refsect2 + |ancestor-or-self::refsect3 + |ancestor-or-self::simplesect + |ancestor-or-self::bibliography + |ancestor-or-self::glossary + |ancestor-or-self::index)[last()]'> + +<!ENTITY section.id 'generate-id(§ion;)'> +<!ENTITY sep '" "'> +]> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<!-- ==================================================================== --> + +<xsl:template match="index|setindex"> + <!-- some implementations use completely empty index tags to indicate --> + <!-- where an automatically generated index should be inserted. so --> + <!-- if the index is completely empty, skip it. --> + <xsl:if test="count(*)>0 or $generate.index"> + <div class="{name(.)}"> + <xsl:call-template name="component.separator"/> + <xsl:choose> + <xsl:when test="./title"> + <xsl:apply-templates select="./title" mode="component.title.mode"/> + </xsl:when> + <xsl:otherwise> + <h2 class="title"> + <a> + <xsl:attribute name="name"> + <xsl:call-template name="object.id"/> + </xsl:attribute> + <xsl:call-template name="gentext.element.name"/> + </a> + </h2> + </xsl:otherwise> + </xsl:choose> + + <xsl:if test="./subtitle"> + <xsl:apply-templates select="./subtitle" mode="component.title.mode"/> + </xsl:if> + + <xsl:apply-templates/> + + <xsl:if test="count(indexentry) = 0 and count(indexdiv) = 0"> + <xsl:call-template name="generate-index"/> + </xsl:if> + + <xsl:call-template name="process.footnotes"/> + </div> + </xsl:if> +</xsl:template> + +<xsl:template match="index/title"></xsl:template> +<xsl:template match="index/subtitle"></xsl:template> +<xsl:template match="index/titleabbrev"></xsl:template> + +<xsl:template match="index/title" mode="component.title.mode"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select=".."/> + </xsl:call-template> + </xsl:variable> + <h2 class="title"> + <a name="{$id}"> + <xsl:apply-templates/> + </a> + </h2> +</xsl:template> + +<xsl:template match="index/subtitle" mode="component.title.mode"> + <h3> + <i><xsl:apply-templates/></i> + </h3> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="indexdiv"> + <div class="{name(.)}"> + <xsl:apply-templates mode="not-indexentrys"/> + <dl> + <xsl:apply-templates select="indexentry"/> + </dl> + </div> +</xsl:template> + +<xsl:template match="indexentry" mode="not-indexentrys"> + <!-- suppress --> +</xsl:template> + +<xsl:template match="indexdiv/title"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select=".."/> + </xsl:call-template> + </xsl:variable> + <h3 class="{name(.)}"> + <a name="{$id}"> + <xsl:apply-templates/> + </a> + </h3> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="indexterm"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + + <a class="indexterm" name="{$id}"/> +</xsl:template> + +<xsl:template match="primary|secondary|tertiary|see|seealso"> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="indexentry"> + <xsl:apply-templates select="primaryie"/> +</xsl:template> + +<xsl:template match="primaryie"> + <dt> + <xsl:apply-templates/> + </dt> + <xsl:choose> + <xsl:when test="following-sibling::secondaryie"> + <dd> + <dl> + <xsl:apply-templates select="following-sibling::secondaryie"/> + </dl> + </dd> + </xsl:when> + <xsl:when test="following-sibling::seeie + |following-sibling::seealsoie"> + <dd> + <dl> + <xsl:apply-templates select="following-sibling::seeie + |following-sibling::seealsoie"/> + </dl> + </dd> + </xsl:when> + </xsl:choose> +</xsl:template> + +<xsl:template match="secondaryie"> + <dt> + <xsl:apply-templates/> + </dt> + <xsl:choose> + <xsl:when test="following-sibling::tertiaryie"> + <dd> + <dl> + <xsl:apply-templates select="following-sibling::tertiaryie"/> + </dl> + </dd> + </xsl:when> + <xsl:when test="following-sibling::seeie + |following-sibling::seealsoie"> + <dd> + <dl> + <xsl:apply-templates select="following-sibling::seeie + |following-sibling::seealsoie"/> + </dl> + </dd> + </xsl:when> + </xsl:choose> +</xsl:template> + +<xsl:template match="tertiaryie"> + <dt> + <xsl:apply-templates/> + </dt> + <xsl:if test="following-sibling::seeie + |following-sibling::seealsoie"> + <dd> + <dl> + <xsl:apply-templates select="following-sibling::seeie + |following-sibling::seealsoie"/> + </dl> + </dd> + </xsl:if> +</xsl:template> + +<xsl:template match="seeie|seealsoie"> + <dt> + <xsl:apply-templates/> + </dt> +</xsl:template> + +<!-- ==================================================================== --> +<!-- Jeni Tennison gets all the credit for what follows. + I think I understand it :-) Anyway, I've hacked it a bit, so the + bugs are mine. --> + +<xsl:key name="letter" + match="indexterm" + use="substring(&primary;, 1, 1)"/> + +<xsl:key name="primary" + match="indexterm" + use="&primary;"/> + +<xsl:key name="secondary" + match="indexterm" + use="concat(&primary;, &sep;, &secondary;)"/> + +<xsl:key name="tertiary" + match="indexterm" + use="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;)"/> + +<xsl:key name="primary-section" + match="indexterm[not(secondary) and not(see)]" + use="concat(&primary;, &sep;, §ion.id;)"/> + +<xsl:key name="secondary-section" + match="indexterm[not(tertiary) and not(see)]" + use="concat(&primary;, &sep;, &secondary;, &sep;, §ion.id;)"/> + +<xsl:key name="tertiary-section" + match="indexterm[not(see)]" + use="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, §ion.id;)"/> + +<xsl:key name="see-also" + match="indexterm[seealso]" + use="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, seealso)"/> + +<xsl:key name="see" + match="indexterm[see]" + use="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, see)"/> + +<xsl:key name="sections" match="*[@id]" use="@id"/> + +<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'"/> +<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/> + +<xsl:template name="generate-index"> + <xsl:variable name="terms" select="//indexterm[count(.|key('letter', + substring(&primary;, 1, 1))[1]) = 1]"/> + <xsl:variable name="alphabetical" + select="$terms[contains(concat($lowercase, $uppercase), + substring(&primary;, 1, 1))]"/> + <xsl:variable name="others" select="$terms[not(contains(concat($lowercase, + $uppercase), + substring(&primary;, 1, 1)))]"/> + <div class="index"> + <xsl:if test="$others"> + <div class="indexdiv"> + <h3> + <xsl:call-template name="gentext"> + <xsl:with-param name="key" select="'index symbols'"/> + </xsl:call-template> + </h3> + <dl> + <xsl:apply-templates select="$others[count(.|key('primary', + &primary;)[1]) = 1]" + mode="index-primary"> + <xsl:sort select="&primary;"/> + </xsl:apply-templates> + </dl> + </div> + </xsl:if> + <xsl:apply-templates select="$alphabetical[count(.|key('letter', + substring(&primary;, 1, 1))[1]) = 1]" + mode="index-div"> + <xsl:sort select="&primary;"/> + </xsl:apply-templates> + </div> +</xsl:template> + +<xsl:template match="indexterm" mode="index-div"> + <xsl:variable name="key" select="substring(&primary;, 1, 1)"/> + <div class="indexdiv"> + <h3> + <xsl:value-of select="translate($key, $lowercase, $uppercase)"/> + </h3> + <dl> + <xsl:apply-templates select="key('letter', $key)[count(.|key('primary', &primary;)[1]) = 1]" + mode="index-primary"> + <xsl:sort select="&primary;"/> + </xsl:apply-templates> + </dl> + </div> +</xsl:template> + +<xsl:template match="indexterm" mode="index-primary"> + <xsl:variable name="key" select="&primary;"/> + <xsl:variable name="refs" select="key('primary', $key)"/> + <dt> + <xsl:value-of select="primary"/> + <xsl:for-each select="$refs[generate-id() = generate-id(key('primary-section', concat($key, &sep;, §ion.id;))[1])]"> + <xsl:apply-templates select="." mode="reference"/> + </xsl:for-each> + </dt> + <xsl:if test="$refs/secondary or $refs[not(secondary)]/*[self::see or self::seealso]"> + <dd> + <dl> + <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &sep;, &sep;, see))[1])]" + mode="index-see"> + <xsl:sort select="see"/> + </xsl:apply-templates> + <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &sep;, &sep;, seealso))[1])]" + mode="index-seealso"> + <xsl:sort select="seealso"/> + </xsl:apply-templates> + <xsl:apply-templates select="$refs[secondary and count(.|key('secondary', concat($key, &sep;, &secondary;))[1]) = 1]" + mode="index-secondary"> + <xsl:sort select="&secondary;"/> + </xsl:apply-templates> + </dl> + </dd> + </xsl:if> +</xsl:template> + +<xsl:template match="indexterm" mode="index-secondary"> + <xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;)"/> + <xsl:variable name="refs" select="key('secondary', $key)"/> + <dt> + <xsl:value-of select="secondary"/> + <xsl:for-each select="$refs[generate-id() = generate-id(key('secondary-section', concat($key, &sep;, §ion.id;))[1])]"> + <xsl:apply-templates select="." mode="reference"/> + </xsl:for-each> + </dt> + <xsl:if test="$refs/tertiary or $refs[not(tertiary)]/*[self::see or self::seealso]"> + <dd> + <dl> + <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &secondary;, &sep;, &sep;, see))[1])]" + mode="index-see"> + <xsl:sort select="see"/> + </xsl:apply-templates> + <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &secondary;, &sep;, &sep;, seealso))[1])]" + mode="index-seealso"> + <xsl:sort select="seealso"/> + </xsl:apply-templates> + <xsl:apply-templates select="$refs[tertiary and count(.|key('tertiary', concat($key, &sep;, &tertiary;))[1]) = 1]" + mode="index-tertiary"> + <xsl:sort select="&tertiary;"/> + </xsl:apply-templates> + </dl> + </dd> + </xsl:if> +</xsl:template> + +<xsl:template match="indexterm" mode="index-tertiary"> + <xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;)"/> + <xsl:variable name="refs" select="key('tertiary', $key)"/> + <dt> + <xsl:value-of select="tertiary"/> + <xsl:for-each select="$refs[generate-id() = generate-id(key('tertiary-section', concat($key, &sep;, §ion.id;))[1])]"> + <xsl:apply-templates select="." mode="reference"/> + </xsl:for-each> + </dt> + <xsl:variable name="see" select="$refs/see | $refs/seealso"/> + <xsl:if test="$see"> + <dd> + <dl> + <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, see))[1])]" + mode="index-see"> + <xsl:sort select="see"/> + </xsl:apply-templates> + <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, seealso))[1])]" + mode="index-seealso"> + <xsl:sort select="seealso"/> + </xsl:apply-templates> + </dl> + </dd> + </xsl:if> +</xsl:template> + +<xsl:template match="indexterm" mode="reference"> + <xsl:text>, </xsl:text> + <xsl:choose> + <xsl:when test="@zone and string(@zone)"> + <xsl:call-template name="reference"> + <xsl:with-param name="zones" select="normalize-space(@zone)"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="§ion;"/> + </xsl:call-template> + </xsl:attribute> + <xsl:apply-templates select="§ion;" mode="title.content"> + <xsl:with-param name="text-only" select="'1'"/> + </xsl:apply-templates> + </a> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="reference"> + <xsl:param name="zones"/> + <xsl:choose> + <xsl:when test="contains($zones, ' ')"> + <xsl:variable name="zone" select="substring-before($zones, ' ')"/> + <xsl:variable name="target" select="key('sections', $zone)"/> + + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$target[1]"/> + </xsl:call-template> + </xsl:attribute> + <xsl:apply-templates select="$target[1]" mode="index-title-content"/> + </a> + <xsl:text>, </xsl:text> + <xsl:call-template name="reference"> + <xsl:with-param name="zones" select="substring-after($zones, ' ')"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="zone" select="$zones"/> + <xsl:variable name="target" select="key('sections', $zone)"/> + + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$target[1]"/> + </xsl:call-template> + </xsl:attribute> + <xsl:apply-templates select="$target[1]" mode="index-title-content"/> + </a> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="indexterm" mode="index-see"> + <dt><xsl:value-of select="see"/></dt> +</xsl:template> + +<xsl:template match="indexterm" mode="index-seealso"> + <dt><xsl:value-of select="seealso"/></dt> +</xsl:template> + +<xsl:template match="*" mode="index-title-content"> + <xsl:apply-templates select="§ion;" mode="title.content"> + <xsl:with-param name="text-only" select="'1'"/> + </xsl:apply-templates> +</xsl:template> + +</xsl:stylesheet> diff --git a/tests/docbook/html/info.xsl b/tests/docbook/html/info.xsl new file mode 100644 index 00000000..b1d66492 --- /dev/null +++ b/tests/docbook/html/info.xsl @@ -0,0 +1,53 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<!-- These templates define the "default behavior" for info + elements. Even if you don't process the *info wrappers, + some of these elements are needed because the elements are + processed from named templates that are called with modes. + Since modes aren't sticky, these rules apply. + (TODO: clarify this comment) --> + +<!-- ==================================================================== --> +<!-- called from named templates in a given mode --> + +<xsl:template match="corpauthor"> + <span class="{name(.)}"> + <xsl:apply-templates/> + </span> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="jobtitle"> + <span class="{name(.)}"> + <xsl:apply-templates/> + </span> +</xsl:template> + +<xsl:template match="orgname"> + <span class="{name(.)}"> + <xsl:apply-templates/> + </span> +</xsl:template> + +<xsl:template match="orgdiv"> + <span class="{name(.)}"> + <xsl:apply-templates/> + </span> +</xsl:template> + +<!-- ==================================================================== --> + +</xsl:stylesheet> diff --git a/tests/docbook/html/inline.xsl b/tests/docbook/html/inline.xsl new file mode 100644 index 00000000..7901a593 --- /dev/null +++ b/tests/docbook/html/inline.xsl @@ -0,0 +1,683 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<xsl:template name="inline.charseq"> + <xsl:param name="content"> + <xsl:if test="@id"> + <a name="{@id}"/> + </xsl:if> + <xsl:apply-templates/> + </xsl:param> + <xsl:copy-of select="$content"/> +</xsl:template> + +<xsl:template name="inline.monoseq"> + <xsl:param name="content"> + <xsl:if test="@id"> + <a name="{@id}"/> + </xsl:if> + <xsl:apply-templates/> + </xsl:param> + <tt><xsl:copy-of select="$content"/></tt> +</xsl:template> + +<xsl:template name="inline.boldseq"> + <xsl:param name="content"> + <xsl:if test="@id"> + <a name="{@id}"/> + </xsl:if> + <xsl:apply-templates/> + </xsl:param> + <!-- don't put <b> inside figure, example, or table titles --> + <xsl:choose> + <xsl:when test="local-name(..) = 'title' + and (local-name(../..) = 'figure' + or local-name(../..) = 'example' + or local-name(../..) = 'table')"> + <xsl:copy-of select="$content"/> + </xsl:when> + <xsl:otherwise> + <b><xsl:copy-of select="$content"/></b> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="inline.italicseq"> + <xsl:param name="content"> + <xsl:if test="@id"> + <a name="{@id}"/> + </xsl:if> + <xsl:apply-templates/> + </xsl:param> + <i><xsl:copy-of select="$content"/></i> +</xsl:template> + +<xsl:template name="inline.boldmonoseq"> + <xsl:param name="content"> + <xsl:if test="@id"> + <a name="{@id}"/> + </xsl:if> + <xsl:apply-templates/> + </xsl:param> + <!-- don't put <b> inside figure, example, or table titles --> + <!-- or other titles that may already be represented with <b>'s. --> + <xsl:choose> + <xsl:when test="local-name(..) = 'title' + and (local-name(../..) = 'figure' + or local-name(../..) = 'example' + or local-name(../..) = 'table' + or local-name(../..) = 'formalpara')"> + <tt><xsl:copy-of select="$content"/></tt> + </xsl:when> + <xsl:otherwise> + <b><tt><xsl:copy-of select="$content"/></tt></b> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="inline.italicmonoseq"> + <xsl:param name="content"> + <xsl:if test="@id"> + <a name="{@id}"/> + </xsl:if> + <xsl:apply-templates/> + </xsl:param> + <i><tt><xsl:copy-of select="$content"/></tt></i> +</xsl:template> + +<xsl:template name="inline.superscriptseq"> + <xsl:param name="content"> + <xsl:if test="@id"> + <a name="{@id}"/> + </xsl:if> + <xsl:apply-templates/> + </xsl:param> + <sup><xsl:copy-of select="$content"/></sup> +</xsl:template> + +<xsl:template name="inline.subscriptseq"> + <xsl:param name="content"> + <xsl:if test="@id"> + <a name="{@id}"/> + </xsl:if> + <xsl:apply-templates/> + </xsl:param> + <sub><xsl:copy-of select="$content"/></sub> +</xsl:template> + +<!-- ==================================================================== --> +<!-- some special cases --> + +<xsl:template match="author"> + <span class="{name(.)}"><xsl:call-template name="person.name"/></span> +</xsl:template> + +<xsl:template match="editor"> + <span class="{name(.)}"><xsl:call-template name="person.name"/></span> +</xsl:template> + +<xsl:template match="othercredit"> + <span class="{name(.)}"><xsl:call-template name="person.name"/></span> +</xsl:template> + +<xsl:template match="authorinitials"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="accel"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="action"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="application"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="classname"> + <xsl:call-template name="inline.monoseq"/> +</xsl:template> + +<xsl:template match="exceptionname"> + <xsl:call-template name="inline.monoseq"/> +</xsl:template> + +<xsl:template match="interfacename"> + <xsl:call-template name="inline.monoseq"/> +</xsl:template> + +<xsl:template match="methodname"> + <xsl:call-template name="inline.monoseq"/> +</xsl:template> + +<xsl:template match="command"> + <xsl:call-template name="inline.boldseq"/> +</xsl:template> + +<xsl:template match="computeroutput"> + <xsl:call-template name="inline.monoseq"/> +</xsl:template> + +<xsl:template match="constant"> + <xsl:call-template name="inline.monoseq"/> +</xsl:template> + +<xsl:template match="database"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="errorcode"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="errorname"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="errortype"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="envar"> + <xsl:call-template name="inline.monoseq"/> +</xsl:template> + +<xsl:template match="filename"> + <xsl:call-template name="inline.monoseq"/> +</xsl:template> + +<xsl:template match="function"> + <xsl:choose> + <xsl:when test="$function.parens != '0' + and (parameter or function or replaceable)"> + <xsl:variable name="nodes" select="text()|*"/> + <xsl:call-template name="inline.monoseq"> + <xsl:with-param name="content"> + <xsl:apply-templates select="$nodes[1]"/> + </xsl:with-param> + </xsl:call-template> + <xsl:text>(</xsl:text> + <xsl:apply-templates select="$nodes[position()>1]"/> + <xsl:text>)</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="inline.monoseq"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="function/parameter" priority="2"> + <xsl:call-template name="inline.italicmonoseq"/> + <xsl:if test="following-sibling::*"> + <xsl:text>, </xsl:text> + </xsl:if> +</xsl:template> + +<xsl:template match="function/replaceable" priority="2"> + <xsl:call-template name="inline.italicmonoseq"/> + <xsl:if test="following-sibling::*"> + <xsl:text>, </xsl:text> + </xsl:if> +</xsl:template> + +<xsl:template match="guibutton"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="guiicon"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="guilabel"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="guimenu"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="guimenuitem"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="guisubmenu"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="hardware"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="interface"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="interfacedefinition"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="keycap"> + <xsl:call-template name="inline.boldseq"/> +</xsl:template> + +<xsl:template match="keycode"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="keysym"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="literal"> + <xsl:call-template name="inline.monoseq"/> +</xsl:template> + +<xsl:template match="medialabel"> + <xsl:call-template name="inline.italicseq"/> +</xsl:template> + +<xsl:template match="shortcut"> + <xsl:call-template name="inline.boldseq"/> +</xsl:template> + +<xsl:template match="mousebutton"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="option"> + <xsl:call-template name="inline.monoseq"/> +</xsl:template> + +<xsl:template match="parameter"> + <xsl:call-template name="inline.italicmonoseq"/> +</xsl:template> + +<xsl:template match="property"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="prompt"> + <xsl:call-template name="inline.monoseq"/> +</xsl:template> + +<xsl:template match="replaceable" priority="1"> + <xsl:call-template name="inline.italicmonoseq"/> +</xsl:template> + +<xsl:template match="returnvalue"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="structfield"> + <xsl:call-template name="inline.italicmonoseq"/> +</xsl:template> + +<xsl:template match="structname"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="symbol"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="systemitem"> + <xsl:call-template name="inline.monoseq"/> +</xsl:template> + +<xsl:template match="token"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="type"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="userinput"> + <xsl:call-template name="inline.boldmonoseq"/> +</xsl:template> + +<xsl:template match="abbrev"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="acronym"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="citerefentry"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="citetitle"> + <xsl:call-template name="inline.italicseq"/> +</xsl:template> + +<xsl:template match="emphasis"> + <xsl:choose> + <xsl:when test="@role='bold'"> + <xsl:call-template name="inline.boldseq"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="inline.italicseq"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="foreignphrase"> + <xsl:call-template name="inline.italicseq"/> +</xsl:template> + +<xsl:template match="markup"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="phrase"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="quote"> + <xsl:variable name="depth"> + <xsl:call-template name="dot.count"> + <xsl:with-param name="string"><xsl:number level="multiple"/></xsl:with-param> + </xsl:call-template> + </xsl:variable> + <xsl:choose> + <xsl:when test="$depth mod 2 = 0"> + <xsl:call-template name="gentext.startquote"/> + <xsl:call-template name="inline.charseq"/> + <xsl:call-template name="gentext.endquote"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="gentext.nestedstartquote"/> + <xsl:call-template name="inline.charseq"/> + <xsl:call-template name="gentext.nestedendquote"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="varname"> + <xsl:call-template name="inline.monoseq"/> +</xsl:template> + +<xsl:template match="wordasword"> + <xsl:call-template name="inline.italicseq"/> +</xsl:template> + +<xsl:template match="lineannotation"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="superscript"> + <xsl:call-template name="inline.superscriptseq"/> +</xsl:template> + +<xsl:template match="subscript"> + <xsl:call-template name="inline.subscriptseq"/> +</xsl:template> + +<xsl:template match="trademark"> + <xsl:call-template name="inline.charseq"/> + <xsl:if test="@class"> + <xsl:call-template name="dingbat"> + <xsl:with-param name="dingbat" select="@class"/> + </xsl:call-template> + </xsl:if> +</xsl:template> + +<xsl:template match="firstterm"> + <xsl:call-template name="inline.italicseq"/> +</xsl:template> + +<xsl:template match="glossterm"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="sgmltag"> + <xsl:call-template name="format.sgmltag"/> +</xsl:template> + +<xsl:template name="format.sgmltag"> + <xsl:param name="class"> + <xsl:choose> + <xsl:when test="@class"> + <xsl:value-of select="@class"/> + </xsl:when> + <xsl:otherwise>element</xsl:otherwise> + </xsl:choose> + </xsl:param> + + <xsl:choose> + <xsl:when test="$class='attribute'"> + <xsl:call-template name="inline.charseq"/> + </xsl:when> + <xsl:when test="$class='attvalue'"> + <xsl:call-template name="inline.monoseq"/> + </xsl:when> + <xsl:when test="$class='element'"> + <xsl:call-template name="inline.monoseq"/> + </xsl:when> + <xsl:when test="$class='endtag'"> + <xsl:call-template name="inline.monoseq"> + <xsl:with-param name="content"> + <xsl:text></</xsl:text> + <xsl:apply-templates/> + <xsl:text>></xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:when test="$class='genentity'"> + <xsl:call-template name="inline.monoseq"> + <xsl:with-param name="content"> + <xsl:text>&</xsl:text> + <xsl:apply-templates/> + <xsl:text>;</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:when test="$class='numcharref'"> + <xsl:call-template name="inline.monoseq"> + <xsl:with-param name="content"> + <xsl:text>&#</xsl:text> + <xsl:apply-templates/> + <xsl:text>;</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:when test="$class='paramentity'"> + <xsl:call-template name="inline.monoseq"> + <xsl:with-param name="content"> + <xsl:text>%</xsl:text> + <xsl:apply-templates/> + <xsl:text>;</xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:when test="$class='pi'"> + <xsl:call-template name="inline.monoseq"> + <xsl:with-param name="content"> + <xsl:text><?</xsl:text> + <xsl:apply-templates/> + <xsl:text>></xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:when test="$class='xmlpi'"> + <xsl:call-template name="inline.monoseq"> + <xsl:with-param name="content"> + <xsl:text><?</xsl:text> + <xsl:apply-templates/> + <xsl:text>?></xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:when test="$class='starttag'"> + <xsl:call-template name="inline.monoseq"> + <xsl:with-param name="content"> + <xsl:text><</xsl:text> + <xsl:apply-templates/> + <xsl:text>></xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:when test="$class='emptytag'"> + <xsl:call-template name="inline.monoseq"> + <xsl:with-param name="content"> + <xsl:text><</xsl:text> + <xsl:apply-templates/> + <xsl:text>/></xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:when test="$class='sgmlcomment'"> + <xsl:call-template name="inline.monoseq"> + <xsl:with-param name="content"> + <xsl:text><!--</xsl:text> + <xsl:apply-templates/> + <xsl:text>--></xsl:text> + </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="inline.charseq"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="email"> + <xsl:call-template name="inline.monoseq"> + <xsl:with-param name="content"> + <xsl:text><</xsl:text> + <a> + <xsl:attribute name="href">mailto:<xsl:value-of select="."/></xsl:attribute> + <xsl:apply-templates/> + </a> + <xsl:text>></xsl:text> + </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="keycombo"> + <xsl:variable name="action" select="@action"/> + <xsl:variable name="joinchar"> + <xsl:choose> + <xsl:when test="$action='seq'"><xsl:text> </xsl:text></xsl:when> + <xsl:when test="$action='simul'">+</xsl:when> + <xsl:when test="$action='press'">-</xsl:when> + <xsl:when test="$action='click'">-</xsl:when> + <xsl:when test="$action='double-click'">-</xsl:when> + <xsl:when test="$action='other'"></xsl:when> + <xsl:otherwise>-</xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:for-each select="./*"> + <xsl:if test="position()>1"><xsl:value-of select="$joinchar"/></xsl:if> + <xsl:apply-templates/> + </xsl:for-each> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="menuchoice"> + <xsl:variable name="shortcut" select="./shortcut"/> + <xsl:call-template name="process.menuchoice"/> + <xsl:if test="$shortcut"> + <xsl:text> (</xsl:text> + <xsl:apply-templates select="$shortcut"/> + <xsl:text>)</xsl:text> + </xsl:if> +</xsl:template> + +<xsl:template name="process.menuchoice"> + <xsl:param name="nodelist" select="guibutton|guiicon|guilabel|guimenu|guimenuitem|guisubmenu|interface"/><!-- not(shortcut) --> + <xsl:param name="count" select="1"/> + + <xsl:choose> + <xsl:when test="$count>count($nodelist)"></xsl:when> + <xsl:when test="$count=1"> + <xsl:apply-templates select="$nodelist[$count=position()]"/> + <xsl:call-template name="process.menuchoice"> + <xsl:with-param name="nodelist" select="$nodelist"/> + <xsl:with-param name="count" select="$count+1"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="node" select="$nodelist[$count=position()]"/> + <xsl:choose> + <xsl:when test="name($node)='guimenuitem' + or name($node)='guisubmenu'"> + <xsl:text>-></xsl:text> + </xsl:when> + <xsl:otherwise>+</xsl:otherwise> + </xsl:choose> + <xsl:apply-templates select="$node"/> + <xsl:call-template name="process.menuchoice"> + <xsl:with-param name="nodelist" select="$nodelist"/> + <xsl:with-param name="count" select="$count+1"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="optional"> + <xsl:value-of select="$arg.choice.opt.open.str"/> + <xsl:call-template name="inline.charseq"/> + <xsl:value-of select="$arg.choice.opt.close.str"/> +</xsl:template> + +<xsl:template match="citation"> + <!-- todo: biblio-citation-check --> + <xsl:text>[</xsl:text> + <xsl:call-template name="inline.charseq"/> + <xsl:text>]</xsl:text> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="comment|remark"> + <xsl:if test="$show.comments != 0"> + <i><xsl:call-template name="inline.charseq"/></i> + </xsl:if> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="productname"> + <xsl:call-template name="inline.charseq"/> + <xsl:if test="@class"> + <xsl:call-template name="dingbat"> + <xsl:with-param name="dingbat" select="@class"/> + </xsl:call-template> + </xsl:if> +</xsl:template> + +<xsl:template match="productnumber"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="pob|street|city|state|postcode|country|phone|fax|otheraddr"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<!-- ==================================================================== --> + +</xsl:stylesheet> + diff --git a/tests/docbook/html/keywords.xsl b/tests/docbook/html/keywords.xsl new file mode 100644 index 00000000..c3b5f706 --- /dev/null +++ b/tests/docbook/html/keywords.xsl @@ -0,0 +1,38 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<xsl:template match="keywordset"></xsl:template> +<xsl:template match="subjectset"></xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="keywordset" mode="html.header"> + <meta name="keywords"> + <xsl:attribute name="content"> + <xsl:apply-templates select="keyword" mode="html.header"/> + </xsl:attribute> + </meta> +</xsl:template> + +<xsl:template match="keyword[position()!=last()]" mode="html.header"> + <xsl:apply-templates/><xsl:text>, </xsl:text> +</xsl:template> + +<xsl:template match="keyword[position()=last()]" mode="html.header"> + <xsl:apply-templates/> +</xsl:template> + +<!-- ==================================================================== --> + +</xsl:stylesheet> diff --git a/tests/docbook/html/lists.xsl b/tests/docbook/html/lists.xsl new file mode 100644 index 00000000..2bae5e6f --- /dev/null +++ b/tests/docbook/html/lists.xsl @@ -0,0 +1,609 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<!-- ==================================================================== --> + +<xsl:template match="itemizedlist"> + <div class="{name(.)}"> + <xsl:if test="title"> + <xsl:apply-templates select="title"/> + </xsl:if> + <ul> + <xsl:apply-templates select="listitem"/> + </ul> + </div> +</xsl:template> + +<xsl:template match="itemizedlist/title"> + <p><b><xsl:apply-templates/></b></p> +</xsl:template> + +<xsl:template name="orderedlist-starting-number"> + <xsl:param name="list" select="."/> + <xsl:choose> + <xsl:when test="$list/@continuation != 'continues'">1</xsl:when> + <xsl:otherwise> + <xsl:variable name="prevlist" + select="$list/preceding::orderedlist[1]"/> + <xsl:choose> + <xsl:when test="count($prevlist) = 0">2</xsl:when> + <xsl:otherwise> + <xsl:variable name="prevlength" select="count($prevlist/listitem)"/> + <xsl:variable name="prevstart"> + <xsl:call-template name="orderedlist-starting-number"> + <xsl:with-param name="list" select="$prevlist"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="$prevstart + $prevlength"/> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="orderedlist"> + <xsl:variable name="start"> + <xsl:choose> + <xsl:when test="@continuation='continues'"> + <xsl:call-template name="orderedlist-starting-number"/> + </xsl:when> + <xsl:otherwise>1</xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="numeration"> + <xsl:choose> + <xsl:when test="@numeration='arabic'">1</xsl:when> + <xsl:when test="@numeration='loweralpha'">a</xsl:when> + <xsl:when test="@numeration='lowerroman'">i</xsl:when> + <xsl:when test="@numeration='upperalpha'">A</xsl:when> + <xsl:when test="@numeration='upperroman'">I</xsl:when> + <xsl:otherwise> + <!-- alternate the numeration based on depth --> + <xsl:variable name="depth" select="count(ancestor::orderedlist)"/> + <xsl:variable name="type" select="$depth mod 5"/> + <xsl:choose> + <xsl:when test="$type = 0">1</xsl:when> + <xsl:when test="$type = 1">a</xsl:when> + <xsl:when test="$type = 2">i</xsl:when> + <xsl:when test="$type = 3">A</xsl:when> + <xsl:when test="$type = 4">I</xsl:when> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <div class="{name(.)}"> + <xsl:if test="title"> + <xsl:apply-templates select="title"/> + </xsl:if> + <ol> + <xsl:if test="$start != '1'"> + <xsl:attribute name="start"> + <xsl:value-of select="$start"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="$numeration != ''"> + <xsl:attribute name="type"> + <xsl:value-of select="$numeration"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="@spacing='compact'"> + <xsl:attribute name="compact"> + <xsl:value-of select="compact"/> + </xsl:attribute> + </xsl:if> + <xsl:apply-templates select="listitem"/> + </ol> + </div> +</xsl:template> + +<xsl:template match="orderedlist/title"> + <p><b><xsl:apply-templates/></b></p> +</xsl:template> + +<xsl:template match="variablelist"> + <div class="{name(.)}"> + <xsl:if test="title"> + <xsl:apply-templates select="title"/> + </xsl:if> + <dl> + <xsl:apply-templates select="varlistentry"/> + </dl> + </div> +</xsl:template> + +<xsl:template match="variablelist/title"> + <p><b><xsl:apply-templates/></b></p> +</xsl:template> + +<xsl:template match="listitem"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + <xsl:variable name="mark" select="ancestor-or-self::*/@mark"/> + <xsl:variable name="override" select="@override"/> + + <xsl:variable name="usemark"> + <xsl:choose> + <xsl:when test="$override != ''"> + <xsl:value-of select="$override"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$mark"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="cssmark"> + <xsl:choose> + <xsl:when test="$usemark = 'bullet'">disc</xsl:when> + <xsl:when test="$usemark = 'box'">square</xsl:when> + <xsl:otherwise> + <xsl:value-of select="$usemark"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <li> + <xsl:if test="$css.decoration = '1' and $cssmark != ''"> + <xsl:attribute name="style"> + <xsl:text>list-style-type: </xsl:text> + <xsl:value-of select="$cssmark"/> + </xsl:attribute> + </xsl:if> + + <!-- we can't just drop the anchor in since some browsers (Opera) + get confused about line breaks if we do. So if the first child + is a para, assume the para will put in the anchor. Otherwise, + put the anchor in anyway. --> + <xsl:if test="local-name(child::*[1]) != 'para'"> + <a name="{$id}"/> + </xsl:if> + + <xsl:choose> + <xsl:when test="$show.revisionflag and @revisionflag"> + <div class="{@revisionflag}"> + <xsl:apply-templates/> + </div> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> + </li> +</xsl:template> + +<xsl:template match="listitem" mode="xref"> + <xsl:number format="1"/> +</xsl:template> + +<xsl:template match="varlistentry"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + <dt><a name="{$id}"/><xsl:apply-templates select="term"/></dt> + <dd><xsl:apply-templates select="listitem"/></dd> +</xsl:template> + +<xsl:template match="varlistentry/term"> + <span class="term"><xsl:apply-templates/>, </span> +</xsl:template> + +<xsl:template match="varlistentry/term[position()=last()]" priority="2"> + <span class="term"><xsl:apply-templates/></span> +</xsl:template> + +<xsl:template match="varlistentry/listitem"> + <xsl:choose> + <xsl:when test="$show.revisionflag and @revisionflag"> + <div class="{@revisionflag}"> + <xsl:apply-templates/> + </div> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + + +<!-- ==================================================================== --> + +<xsl:template match="simplelist"> + <!-- with no type specified, the default is 'vert' --> + <table class="simplelist" border="0" summary="Simple list"> + <xsl:call-template name="simplelist.vert"> + <xsl:with-param name="cols"> + <xsl:choose> + <xsl:when test="@columns"> + <xsl:value-of select="@columns"/> + </xsl:when> + <xsl:otherwise>1</xsl:otherwise> + </xsl:choose> + </xsl:with-param> + </xsl:call-template> + </table> +</xsl:template> + +<xsl:template match="simplelist[@type='inline']"> + <span class="{name(.)}"><xsl:apply-templates/></span> +</xsl:template> + +<xsl:template match="simplelist[@type='horiz']"> + <table class="simplelist" border="0" summary="Simple list"> + <xsl:call-template name="simplelist.horiz"> + <xsl:with-param name="cols"> + <xsl:choose> + <xsl:when test="@columns"> + <xsl:value-of select="@columns"/> + </xsl:when> + <xsl:otherwise>1</xsl:otherwise> + </xsl:choose> + </xsl:with-param> + </xsl:call-template> + </table> +</xsl:template> + +<xsl:template match="simplelist[@type='vert']"> + <table class="simplelist" border="0" summary="Simple list"> + <xsl:call-template name="simplelist.vert"> + <xsl:with-param name="cols"> + <xsl:choose> + <xsl:when test="@columns"> + <xsl:value-of select="@columns"/> + </xsl:when> + <xsl:otherwise>1</xsl:otherwise> + </xsl:choose> + </xsl:with-param> + </xsl:call-template> + </table> +</xsl:template> + +<xsl:template name="simplelist.horiz"> + <xsl:param name="cols">1</xsl:param> + <xsl:param name="cell">1</xsl:param> + <xsl:param name="members" select="./member"/> + + <xsl:if test="$cell <= count($members)"> + <tr> + <xsl:call-template name="simplelist.horiz.row"> + <xsl:with-param name="cols" select="$cols"/> + <xsl:with-param name="cell" select="$cell"/> + <xsl:with-param name="members" select="$members"/> + </xsl:call-template> + </tr> + <xsl:call-template name="simplelist.horiz"> + <xsl:with-param name="cols" select="$cols"/> + <xsl:with-param name="cell" select="$cell + $cols"/> + <xsl:with-param name="members" select="$members"/> + </xsl:call-template> + </xsl:if> +</xsl:template> + +<xsl:template name="simplelist.horiz.row"> + <xsl:param name="cols">1</xsl:param> + <xsl:param name="cell">1</xsl:param> + <xsl:param name="members" select="./member"/> + <xsl:param name="curcol">1</xsl:param> + + <xsl:if test="$curcol <= $cols"> + <td> + <xsl:choose> + <xsl:when test="$members[position()=$cell]"> + <xsl:apply-templates select="$members[position()=$cell]"/> + </xsl:when> + <xsl:otherwise> + <xsl:choose> + <xsl:when test="$using.chunker != 0"> + <xsl:text> </xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> + </td> + <xsl:call-template name="simplelist.horiz.row"> + <xsl:with-param name="cols" select="$cols"/> + <xsl:with-param name="cell" select="$cell+1"/> + <xsl:with-param name="members" select="$members"/> + <xsl:with-param name="curcol" select="$curcol+1"/> + </xsl:call-template> + </xsl:if> +</xsl:template> + +<xsl:template name="simplelist.vert"> + <xsl:param name="cols">1</xsl:param> + <xsl:param name="cell">1</xsl:param> + <xsl:param name="members" select="./member"/> + <xsl:param name="rows" + select="floor((count($members)+$cols - 1) div $cols)"/> + + <xsl:if test="$cell <= $rows"> + <tr> + <xsl:call-template name="simplelist.vert.row"> + <xsl:with-param name="cols" select="$cols"/> + <xsl:with-param name="rows" select="$rows"/> + <xsl:with-param name="cell" select="$cell"/> + <xsl:with-param name="members" select="$members"/> + </xsl:call-template> + </tr> + <xsl:call-template name="simplelist.vert"> + <xsl:with-param name="cols" select="$cols"/> + <xsl:with-param name="cell" select="$cell+1"/> + <xsl:with-param name="members" select="$members"/> + <xsl:with-param name="rows" select="$rows"/> + </xsl:call-template> + </xsl:if> +</xsl:template> + +<xsl:template name="simplelist.vert.row"> + <xsl:param name="cols">1</xsl:param> + <xsl:param name="rows">1</xsl:param> + <xsl:param name="cell">1</xsl:param> + <xsl:param name="members" select="./member"/> + <xsl:param name="curcol">1</xsl:param> + + <xsl:if test="$curcol <= $cols"> + <td> + <xsl:choose> + <xsl:when test="$members[position()=$cell]"> + <xsl:apply-templates select="$members[position()=$cell]"/> + </xsl:when> + <xsl:otherwise> + <xsl:choose> + <xsl:when test="$using.chunker != 0"> + <xsl:text> </xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> + </td> + <xsl:call-template name="simplelist.vert.row"> + <xsl:with-param name="cols" select="$cols"/> + <xsl:with-param name="rows" select="$rows"/> + <xsl:with-param name="cell" select="$cell+$rows"/> + <xsl:with-param name="members" select="$members"/> + <xsl:with-param name="curcol" select="$curcol+1"/> + </xsl:call-template> + </xsl:if> +</xsl:template> + +<xsl:template match="member"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="simplelist[@type='inline']/member"> + <xsl:apply-templates/> + <xsl:text>, </xsl:text> +</xsl:template> + +<xsl:template match="simplelist[@type='inline']/member[position()=last()]" + priority="2"> + <xsl:apply-templates/> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="procedure"> + <div class="{name(.)}"> + <xsl:if test="title"> + <xsl:apply-templates select="title" mode="procedure.title.mode"/> + </xsl:if> + <ol><xsl:apply-templates/></ol> + </div> +</xsl:template> + +<xsl:template match="procedure/title"> +</xsl:template> + +<xsl:template match="title" mode="procedure.title.mode"> + <p> + <b> + <xsl:apply-templates/> + </b> + </p> +</xsl:template> + +<xsl:template match="substeps"> + <ol><xsl:apply-templates/></ol> +</xsl:template> + +<xsl:template match="step"> + <li><xsl:apply-templates/></li> +</xsl:template> + +<xsl:template match="step/title"> + <xsl:apply-templates select="." mode="procedure.title.mode"/> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="segmentedlist"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="segmentedlist/title"> + <p><b><xsl:apply-templates/></b></p> +</xsl:template> + +<xsl:template match="segtitle"> +</xsl:template> + +<xsl:template match="segtitle" mode="segtitle-in-seg"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="seglistitem"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="seg"> + <xsl:variable name="segnum" select="position()"/> + <xsl:variable name="seglist" select="ancestor::segmentedlist"/> + <xsl:variable name="segtitles" select="$seglist/segtitle"/> + + <!-- + Note: segtitle is only going to be the right thing in a well formed + SegmentedList. If there are too many Segs or too few SegTitles, + you'll get something odd...maybe an error + --> + + <p> + <b> + <xsl:apply-templates select="$segtitles[$segnum=position()]" + mode="segtitle-in-seg"/> + <xsl:text>: </xsl:text> + </b> + <xsl:apply-templates/> + </p> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="calloutlist"> + <div class="{name(.)}"> + <xsl:if test="./title"> + <p> + <b> + <xsl:apply-templates select="./title" mode="calloutlist.title.mode"/> + </b> + </p> + </xsl:if> + <xsl:choose> + <xsl:when test="$callout.list.table != 0"> + <table border="0" summary="Callout list"> + <xsl:apply-templates/> + </table> + </xsl:when> + <xsl:otherwise> + <dl compact="compact"><xsl:apply-templates/></dl> + </xsl:otherwise> + </xsl:choose> + </div> +</xsl:template> + +<xsl:template match="calloutlist/title"> +</xsl:template> + +<xsl:template match="calloutlist/title" mode="calloutlist.title.mode"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="callout"> + <xsl:choose> + <xsl:when test="$callout.list.table != 0"> + <tr> + <td width="5%" valign="top" align="left"> + <xsl:call-template name="callout.arearefs"> + <xsl:with-param name="arearefs" select="@arearefs"/> + </xsl:call-template> + </td> + <td valign="top" align="left"> + <xsl:apply-templates/> + </td> + </tr> + </xsl:when> + <xsl:otherwise> + <dt> + <xsl:call-template name="callout.arearefs"> + <xsl:with-param name="arearefs" select="@arearefs"/> + </xsl:call-template> + </dt> + <dd><xsl:apply-templates/></dd> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="callout.arearefs"> + <xsl:param name="arearefs"></xsl:param> + <xsl:if test="$arearefs!=''"> + <xsl:choose> + <xsl:when test="substring-before($arearefs,' ')=''"> + <xsl:call-template name="callout.arearef"> + <xsl:with-param name="arearef" select="$arearefs"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="callout.arearef"> + <xsl:with-param name="arearef" + select="substring-before($arearefs,' ')"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + <xsl:call-template name="callout.arearefs"> + <xsl:with-param name="arearefs" + select="substring-after($arearefs,' ')"/> + </xsl:call-template> + </xsl:if> +</xsl:template> + +<xsl:template name="callout.arearef"> + <xsl:param name="arearef"></xsl:param> + <xsl:variable name="targets" select="id($arearef)"/> + <xsl:variable name="target" select="$targets[1]"/> + + <xsl:choose> + <xsl:when test="count($target)=0"> + <xsl:value-of select="$arearef"/> + <xsl:text>: ???</xsl:text> + </xsl:when> + <xsl:when test="local-name($target)='co'"> + <a> + <xsl:attribute name="href"> + <xsl:text>#</xsl:text> + <xsl:value-of select="$arearef"/> + </xsl:attribute> + <xsl:apply-templates select="$target" mode="callout-bug"/> + </a> + <xsl:text> </xsl:text> + </xsl:when> + <xsl:when test="local-name($target)='areaset'"> + <xsl:call-template name="callout-bug"> + <xsl:with-param name="conum"> + <xsl:apply-templates select="$target" mode="conumber"/> + </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:when test="local-name($target)='area'"> + <xsl:choose> + <xsl:when test="$target/parent::areaset"> + <xsl:call-template name="callout-bug"> + <xsl:with-param name="conum"> + <xsl:apply-templates select="$target/parent::areaset" + mode="conumber"/> + </xsl:with-param> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="callout-bug"> + <xsl:with-param name="conum"> + <xsl:apply-templates select="$target" mode="conumber"/> + </xsl:with-param> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:text>???</xsl:text> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- ==================================================================== --> + +</xsl:stylesheet> + diff --git a/tests/docbook/html/math.xsl b/tests/docbook/html/math.xsl new file mode 100644 index 00000000..502a930d --- /dev/null +++ b/tests/docbook/html/math.xsl @@ -0,0 +1,22 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<xsl:template match="inlineequation"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="alt"> +</xsl:template> + +</xsl:stylesheet> diff --git a/tests/docbook/html/param.xsl b/tests/docbook/html/param.xsl new file mode 100644 index 00000000..de1e1315 --- /dev/null +++ b/tests/docbook/html/param.xsl @@ -0,0 +1,947 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" + exclude-result-prefixes="doc" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<doc:reference xmlns=""> +<referenceinfo> +<releaseinfo role="meta"> +$Id$ +</releaseinfo> +<author><surname>Walsh</surname> +<firstname>Norman</firstname></author> +<copyright><year>1999</year><year>2000</year> +<holder>Norman Walsh</holder> +</copyright> +</referenceinfo> +<title>HTML Parameter Reference</title> + +<partintro> +<section><title>Introduction</title> + +<para>This is technical reference documentation for the DocBook XSL +Stylesheets; it documents (some of) the parameters, templates, and +other elements of the stylesheets.</para> + +<para>This reference describes each of the HTML Stylesheet parameters. +These are the <quote>easily customizable</quote> parts of the stylesheet. +If you want to specify an alternate value for one or more of these +parameters, you can do so in a <quote>driver</quote> stylesheet.</para> + +<para>For example, if you want to change the <literal>html.stylesheet</literal> +to <filename>reference.css</filename>, you might create a driver +stylesheet like this:</para> + +<programlisting><![CDATA[<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + + <xsl:import href="/path/to/html/docbook.xsl"/> + + <xsl:param name="html.stylesheet">reference.css</xsl:param> + +</xsl:stylesheet>]]></programlisting> + +<para>Naturally, you have to change the +<sgmltag class='attribute'>href</sgmltag> attribute on +<literal><xsl:import></literal> +to point to <filename>docbook.xsl</filename> +on your system. (Or <filename>chunk.xsl</filename>, if you're using +chunking.)</para> + +<para>This is not intended to be <quote>user</quote> documentation. +It is provided for developers writing customization layers for the +stylesheets, and for anyone who's interested in <quote>how it +works</quote>.</para> + +<para>Although I am trying to be thorough, this documentation is known +to be incomplete. Don't forget to read the source, too :-)</para> +</section> +</partintro> +</doc:reference> + +<!-- ==================================================================== --> +<xsl:param name="author.othername.in.middle" select="1" doc:type='boolean'/> + +<doc:param name="author.othername.in.middle" xmlns=""> +<refpurpose>Is <sgmltag>othername</sgmltag> in <sgmltag>author</sgmltag> a +middle name?</refpurpose> +<refdescription> +<para>If true (non-zero), the <sgmltag>othername</sgmltag> of an <sgmltag>author</sgmltag> +appears between the <sgmltag>firstname</sgmltag> and +<sgmltag>surname</sgmltag>. Otherwise, <sgmltag>othername</sgmltag> +is suppressed. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="html.stylesheet" select="''" doc:type='string'/> + +<doc:param name="html.stylesheet" xmlns=""> +<refpurpose>Name of the stylesheet to use in the generated HTML</refpurpose> +<refdescription> +<para>The name of the stylesheet to place in the HTML <sgmltag>LINK</sgmltag> +tag, or the empty string to suppress the stylesheet <sgmltag>LINK</sgmltag>. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="html.stylesheet.type" doc:type='string'>text/css</xsl:param> + +<doc:param name="html.stylesheet.type" xmlns=""> +<refpurpose>The type of the stylesheet used in the generated HTML</refpurpose> +<refdescription> +<para>The type of the stylesheet to place in the HTML <sgmltag>link</sgmltag> tag. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="html.base" doc:type='uri'></xsl:param> + +<doc:param name="html.base" xmlns=""> +<refpurpose>An HTML base URI</refpurpose> +<refdescription> +<para>If html.base is set, it is used for the <sgmltag>BASE</sgmltag> +element in the <sgmltag>HEAD</sgmltag> of the HTML documents. +This is useful for dynamically served HTML where the base URI needs +to be shifted.</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="ulink.target" select="'_top'" doc:type='string'/> + +<doc:param name="ulink.target" xmlns=""> +<refpurpose>The HTML anchor target for ULinks</refpurpose> +<refdescription> +<para>If <parameter>ulink.target</parameter> is set, its value will +be used for the <sgmltag class='attribute'>target</sgmltag> attribute +on anchors generated for <sgmltag>ulink</sgmltag>s.</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="refentry.xref.manvolnum" select="1" doc:type='boolean'/> + +<doc:param name="refentry.xref.manvolnum" xmlns=""> +<refpurpose>Output <sgmltag>manvolnum</sgmltag> as part of +<sgmltag>refentry</sgmltag> cross-reference?</refpurpose> +<refdescription> +<para>if true (non-zero), the <sgmltag>manvolnum</sgmltag> is used when cross-referencing +<sgmltag>refentry</sgmltag>s, either with <sgmltag>xref</sgmltag> +or <sgmltag>citerefentry</sgmltag>. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="show.comments" doc:type='boolean'>1</xsl:param> + +<doc:param name="show.comments" xmlns=""> +<refpurpose>Display <sgmltag>comment</sgmltag> elements?</refpurpose> +<refdescription> +<para>If true (non-zero), comments will be displayed, otherwise they are suppressed. +Comments here refers to the <sgmltag>comment</sgmltag> element, +which will be renamed <sgmltag>remark</sgmltag> in DocBook V4.0, +not XML comments (<-- like this -->) which are unavailable. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="funcsynopsis.style" + doc:type='list' + doc:list='ansi kr'>kr</xsl:param> + +<doc:param name="funcsynopsis.style" xmlns=""> +<refpurpose>What style of 'FuncSynopsis' should be generated?</refpurpose> +<refdescription> +<para>If <varname>funcsynopsis.style</varname> is <literal>ansi</literal>, +ANSI-style function synopses are generated for a +<sgmltag>funcsynopsis</sgmltag>, otherwise K&R-style +function synopses are generated. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="funcsynopsis.decoration" select="1" doc:type='boolean'/> + +<doc:param name="funcsynopsis.decoration" xmlns=""> +<refpurpose>Decorate elements of a FuncSynopsis?</refpurpose> +<refdescription> +<para>If true (non-zero), elements of the FuncSynopsis will be decorated (e.g. bold or +italic). The decoration is controlled by functions that can be redefined +in a customization layer. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="function.parens" doc:type='boolean'>0</xsl:param> + +<doc:param name="function.parens" xmlns=""> +<refpurpose>Generate parens after a function?</refpurpose> +<refdescription> +<para>If not 0, the formatting of +a <sgmltag class="starttag">function</sgmltag> element will include +generated parenthesis. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="refentry.generate.name" select="1" doc:type='boolean'/> + +<doc:param name="refentry.generate.name" xmlns=""> +<refpurpose>Output NAME header before 'RefName'(s)?</refpurpose> +<refdescription> +<para>If true (non-zero), a "NAME" section title is output before the list +of 'RefName's. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="admon.graphics" select="0" doc:type='boolean'/> + +<doc:param name="admon.graphics" xmlns=""> +<refpurpose>Use graphics in admonitions?</refpurpose> +<refdescription> +<para>If true (non-zero), admonitions are presented in an alternate style that uses +a graphic. Default graphics are provided in the distribution. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="admon.graphics.path" doc:type='string'>../images/</xsl:param> + +<doc:param name="admon.graphics.path" xmlns=""> +<refpurpose>Path to admonition graphics</refpurpose> +<refdescription> +<para>Sets the path, probably relative to the directory where the HTML +files are created, to the admonition graphics. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="admon.graphics.extension" select="'.png'" doc:type='string'/> + +<doc:param name="admon.graphics.extension" xmlns=""> +<refpurpose>Extension for admonition graphics</refpurpose> +<refdescription> +<para>Sets the extension to use on admonition graphics.</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="admon.style" doc:type='string'> + <xsl:text>margin-left: 0.5in; margin-right: 0.5in;</xsl:text> +</xsl:param> + +<doc:param name="admon.style" xmlns=""> +<refpurpose>CSS style attributes for admonitions</refpurpose> +<refdescription> +<para>Specifies the value of the <sgmltag class="attribute">STYLE</sgmltag> +attribute that should be added to admonitions. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="section.autolabel" select="0" doc:type='boolean'/> + +<doc:param name="section.autolabel" xmlns=""> +<refpurpose>Are sections enumerated?</refpurpose> +<refdescription> +<para>If true (non-zero), unlabeled sections will be enumerated. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="section.label.includes.component.label" select="0" + doc:type='boolean'/> + +<doc:param name="section.label.includes.component.label" xmlns=""> +<refpurpose>Do section labels include the component label?</refpurpose> +<refdescription> +<para>If true (non-zero), section labels are prefixed with the label of the +component that contains them. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="chapter.autolabel" select="1" doc:type='boolean'/> + +<doc:param name="chapter.autolabel" xmlns=""> +<refpurpose>Are chapters and appendixes enumerated?</refpurpose> +<refdescription> +<para>If true (non-zero), unlabeled chapters and appendixes will be enumerated. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="preface.autolabel" select="0" doc:type='boolean'/> + +<doc:param name="preface.autolabel" xmlns=""> +<refpurpose>Are prefaces enumerated?</refpurpose> +<refdescription> +<para>If true (non-zero), unlabeled prefaces will be enumerated. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="part.autolabel" select="1" doc:type='boolean'/> + +<doc:param name="part.autolabel" xmlns=""> +<refpurpose>Are parts and references enumerated?</refpurpose> +<refdescription> +<para>If true (non-zero), unlabeled parts and references will be enumerated. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="qandadiv.autolabel" select="1" doc:type='boolean'/> + +<doc:param name="qandadiv.autolabel" xmlns=""> +<refpurpose>Are divisions in QAndASets enumerated?</refpurpose> +<refdescription> +<para>If true (non-zero), unlabeled qandadivs will be enumerated. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="qanda.inherit.numeration" select="1" doc:type='boolean'/> + +<doc:param name="qanda.inherit.numeration" xmlns=""> +<refpurpose>Does enumeration of QandASet components inherit the numeration of parent elements?</refpurpose> +<refdescription> +<para>If true (non-zero), numbered QandADiv elements and Questions and Answers inherit +the numeration of the ancestors of the QandASet. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="qanda.defaultlabel" + doc:type='boolean' + doc:list='qanda number none'>number</xsl:param> + +<doc:param name="qanda.defaultlabel" xmlns=""> +<refpurpose>Sets the default for defaultlabel on QandASet.</refpurpose> +<refdescription> +<para>If no defaultlabel attribute is specified on a QandASet, this +value is used. It must be one of the legal values for the defaultlabel +attribute. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="generate.qandaset.toc" doc:type='boolean'>1</xsl:param> + +<doc:param name="generate.qandaset.toc" xmlns=""> +<refpurpose>Is a Table of Contents created for QandASets?</refpurpose> +<refdescription> +<para>If true (non-zero), a ToC is constructed for QandASets. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="generate.qandadiv.toc" doc:type='boolean'>0</xsl:param> + +<doc:param name="generate.qandadiv.toc" xmlns=""> +<refpurpose>Is a Table of Contents created for QandADivs?</refpurpose> +<refdescription> +<para>If true (non-zero), a ToC is constructed for QandADivs. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="biblioentry.item.separator" doc:type='string'>. </xsl:param> + +<doc:param name="biblioentry.item.separator" xmlns=""> +<refpurpose>Text to separate bibliography entries</refpurpose> +<refdescription> +<para>Text to separate bibliography entries +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="toc.section.depth" + doc:type='integer' + doc:min='1' + doc:max='10'>2</xsl:param> + +<doc:param name="toc.section.depth" xmlns=""> +<refpurpose>How deep should recursive <sgmltag>section</sgmltag>s appear +in the TOC?</refpurpose> +<refdescription> +<para>Specifies the depth to which recursive sections should appear in the +TOC. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="using.chunker" select="0" doc:type='boolean'/> + +<doc:param name="using.chunker" xmlns=""> +<refpurpose>Will the output be chunked?</refpurpose> +<refdescription> +<para>In addition to providing chunking, the chunker can cleanup a +number of XML to HTML issues. If the chunker is not being used, the +stylesheets try to avoid producing results that will not appear properly +in browsers. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="generate.component.toc" select="1" doc:type='boolean'/> + +<doc:param name="generate.component.toc" xmlns=""> +<refpurpose>Should TOCs be genereated in components (Chapters, Appendixes, etc.)?</refpurpose> +<refdescription> +<para>If true (non-zero), they are. +</para> +</refdescription> +</doc:param> +<!-- ==================================================================== --> +<xsl:param name="generate.division.toc" select="1" doc:type='boolean'/> + +<doc:param name="generate.division.toc" xmlns=""> +<refpurpose>Should TOCs be genereated in divisions (Books, Parts, etc.)?</refpurpose> +<refdescription> +<para>If true (non-zero), they are. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="link.mailto.url" doc:type='string'></xsl:param> + +<doc:param name="link.mailto.url" xmlns=""> +<refpurpose>Mailto URL for the LINK REL=made HTML HEAD element</refpurpose> +<refdescription> +<para>If not the empty string, this address will be used for the +REL=made <sgmltag>LINK</sgmltag> element in the HTML <sgmltag>HEAD</sgmltag>. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="graphic.default.extension" doc:type='string'></xsl:param> + +<doc:param name="graphic.default.extension" xmlns=""> +<refpurpose>Default extension for graphic filenames</refpurpose> +<refdescription> +<para>If a <sgmltag>graphic</sgmltag> or <sgmltag>mediaobject</sgmltag> +includes a reference to a filename that does not include an extension, +and the <sgmltag class="attribute">format</sgmltag> attribute is +<emphasis>unspecified</emphasis>, the default extension will be used. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="toc.list.type" + doc:type='list' + doc:list='dl ul ol'>dl</xsl:param> + +<doc:param name="toc.list.type" xmlns=""> +<refpurpose>Type of HTML list element to use for Tables of Contents</refpurpose> +<refdescription> +<para>When an automatically generated Table of Contents (or List of Titles) +is produced, this HTML element will be used to make the list. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="check.idref" doc:type='boolean'>1</xsl:param> + +<doc:param name="check.idref" xmlns=""> +<refpurpose>Test the target of IDREF attributes?</refpurpose> +<refdescription> +<para>If 1, the target of IDREF attributes are tested for presence +(and uniqueness). This can be very expensive in large documents. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="use.id.function" doc:type='boolean' select="'1'"/> + +<doc:param name="use.id.function" xmlns=""> +<refpurpose>Use the XPath id() function to find link targets?</refpurpose> +<refdescription> +<para>If 1, the stylesheets use the <function>id()</function> function +to find the targets of cross reference elements. This is more +efficient, but only works if your XSLT processor implements the +<function>id()</function> function, naturally.</para> +<para>THIS PARAMETER IS NOT SUPPORTED. IT IS ALWAYS ASSUMED TO BE 1. +SEE xref.xsl IF YOU NEED TO TURN IT OFF.</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="spacing.paras" doc:type='boolean' select="'1'"/> + +<doc:param name="spacing.paras" xmlns=""> +<refpurpose>Insert additional <p> elements for spacing?</refpurpose> +<refdescription> +<para>When non-zero, additional, empty paragraphs are inserted in +several contexts (for example, around informal figures), to create a +more pleasing visual appearance in many browsers. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:attribute-set name="body.attrs"> + <xsl:attribute name="bgcolor">white</xsl:attribute> + <xsl:attribute name="text">black</xsl:attribute> + <xsl:attribute name="link">#0000FF</xsl:attribute> + <xsl:attribute name="vlink">#840084</xsl:attribute> + <xsl:attribute name="alink">#0000FF</xsl:attribute> +</xsl:attribute-set> + +<doc:attribute-set name="body.attrs" xmlns=""> +<refpurpose>Additional attributes for the HTML body tag</refpurpose> +<refdescription> +<para>The attributes defined by this attribute set are added to the +HTML <body> tag. +</para> +</refdescription> +</doc:attribute-set> + +<!-- ==================================================================== --> +<xsl:param name="css.decoration" doc:type='boolean'>1</xsl:param> + +<doc:param name="css.decoration" xmlns=""> +<refpurpose>Enable CSS decoration of elements</refpurpose> +<refdescription> +<para> +If <literal>css.decoration</literal> is turned on, then HTML elements +produced by the +stylesheet may be decorated with STYLE attributes. For example, the +LI tags produced for list items may include a fragment of CSS in the +STYLE attribute which sets the CSS property "list-style-type". +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="show.revisionflag" doc:type='boolean'>0</xsl:param> + +<doc:param name="show.revisionflag" xmlns=""> +<refpurpose>Enable decoration of elements that have a revisionflag</refpurpose> +<refdescription> +<para> +If <literal>show.revisionflag</literal> is turned on, then the stylesheets +may produce additional markup designed to allow a CSS stylesheet to +highlight elements that have specific revisionflag settings.</para> + +<para>The markup inserted will be usually be either a <span> or <div> +with an appropriate <literal>class</literal> attribute. (The value of +the class attribute will be the same as the value of the revisionflag +attribute). In some contexts, for example tables, where extra markup +would be structurally illegal, the class attribute will be added to the +appropriate container element.</para> + +<para>In general, the stylesheets only test for revisionflag in contexts +where an importing stylesheet would have to redefine whole templates. +Most of the revisionflag processing is expected to be done by another +stylesheet, for example <filename>changebars.xsl</filename>.</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="suppress.navigation" doc:type='boolean'>0</xsl:param> + +<doc:param name="suppress.navigation" xmlns=""> +<refpurpose>Disable header and footer navigation</refpurpose> +<refdescription> +<para> +If <literal>suppress.navigation</literal> is turned on, header and +footer navigation will be suppressed.</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="rootid" select="''" doc:type='string'/> + +<doc:param name="rootid" xmlns=""> +<refpurpose>Specify the root element to format</refpurpose> +<refdescription> +<para>If <parameter>rootid</parameter> is specified, it must be the +value of an ID that occurs in the document being formatted. The entire +document will be loaded and parsed, but formatting will begin at the +element identified, rather than at the root. For example, this allows +you to process only chapter 4 of a book.</para> +<para>Because the entire document is available to the processor, automatic +numbering, cross references, and other dependencies are correctly +resolved.</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="callout.list.table" select="'1'" doc:type='boolean'/> + +<doc:param name="callout.list.table" xmlns=""> +<refpurpose>Present callout lists using a table?</refpurpose> +<refdescription> +<para>The default presentation of <sgmltag>CalloutList</sgmltag>s uses +an HTML <sgmltag>DL</sgmltag>. Some browsers don't align DLs very well +if <parameter>callout.graphics</parameter> are used. With this option +turned on, <sgmltag>CalloutList</sgmltag>s are presented in an HTML +<sgmltag>TABLE</sgmltag>, which usually results in better alignment +of the callout number with the callout description.</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="callout.graphics" select="'1'" doc:type='boolean'/> + +<doc:param name="callout.graphics" xmlns=""> +<refpurpose>Use graphics for callouts?</refpurpose> +<refdescription> +<para>If non-zero, callouts are presented with graphics (e.g., reverse-video +circled numbers instead of "(1)", "(2)", etc.). +Default graphics are provided in the distribution. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="callout.graphics.extension" select="'.png'" doc:type='string'/> + +<doc:param name="callout.graphics.extension" xmlns=""> +<refpurpose>Extension for callout graphics</refpurpose> +<refdescription> +<para>Sets the extension to use on callout graphics.</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="callout.graphics.path" select="'../images/callouts/'" doc:type='string'/> + +<doc:param name="callout.graphics.path" xmlns=""> +<refpurpose>Path to callout graphics</refpurpose> +<refdescription> +<para>Sets the path, probably relative to the directory where the HTML +files are created, to the callout graphics. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="callout.graphics.number.limit" select="'10'" + doc:type='integer'/> + +<doc:param name="callout.graphics.number.limit" xmlns=""> +<refpurpose>Number of the largest callout graphic</refpurpose> +<refdescription> +<para>If <parameter>callout.graphics</parameter> +is non-zero, graphics are used to represent +callout numbers. The value of +<parameter>callout.graphics.number.limit</parameter> +is +the largest number for which a graphic exists. If the callout number +exceeds this limit, the default presentation "(nnn)" will always +be used. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="saxon.extensions" select="'0'" doc:type='boolean'/> + +<doc:param name="saxon.extensions" xmlns=""> +<refpurpose>Enable Saxon extensions</refpurpose> +<refdescription> +<para>If non-zero, saxon extensions may be used. Each extension is +further controlled by its own parameter. But if +<parameter>saxon.extensions</parameter> is zero, no extensions will +be used. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="saxon.textinsert" select="'1'" doc:type='boolean'/> + +<doc:param name="saxon.textinsert" xmlns=""> +<refpurpose>Enable the textinsert extension element</refpurpose> +<refdescription> +<para>The textinsert extension element inserts the contents of a +a file into the result tree (as text). +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="saxon.linenumbering" select="'1'" doc:type='boolean'/> + +<doc:param name="saxon.linenumbering" xmlns=""> +<refpurpose>Enable the line numbering extension</refpurpose> +<refdescription> +<para>If true, verbatim environments (elements that have the +format='linespecific' notation attribute: address, literallayout, +programlisting, screen, synopsis) that specify line numbering will +have, surprise, line numbers. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="linenumbering.everyNth" select="'5'" doc:type='integer'/> + +<doc:param name="linenumbering.everyNth" xmlns=""> +<refpurpose>Indicate which lines should be numbered</refpurpose> +<refdescription> +<para>If line numbering is enabled, everyNth line will be numbered. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="linenumbering.width" select="'3'" doc:type='integer'/> + +<doc:param name="linenumbering.width" xmlns=""> +<refpurpose>Indicates the width of line numbers</refpurpose> +<refdescription> +<para>If line numbering is enabled, line numbers will appear right +justified in a field "width" characters wide. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="linenumbering.separator" select="' '" doc:type='string'/> + +<doc:param name="linenumbering.separator" xmlns=""> +<refpurpose>Specify a separator between line numbers and lines</refpurpose> +<refdescription> +<para>The separator is inserted between line numbers and lines in +the verbatim environment. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="saxon.callouts" select="'1'" doc:type='boolean'/> + +<doc:param name="saxon.callouts" xmlns=""> +<refpurpose>Enable the callout extension</refpurpose> +<refdescription> +<para>The callouts extension processes <sgmltag>areaset</sgmltag> +elements in <sgmltag>ProgramListingCO</sgmltag> and other text-based +callout elements. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="callout.defaultcolumn" select="'60'" doc:type='integer'/> + +<doc:param name="callout.defaultcolumn" xmlns=""> +<refpurpose>Indicates what column callouts appear in by default</refpurpose> +<refdescription> +<para>If a callout does not identify a column (for example, if it uses +the <literal>linerange</literal> <sgmltag class="attribute">unit</sgmltag>), +it will appear in the default column. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="stylesheet.result.type" select="'html'" + doc:type='list' + doc:list='html fo'/> + +<doc:param name="stylesheet.result.type" xmlns=""> +<refpurpose>Identifies the output format of this stylesheet</refpurpose> +<refdescription> +<para>The Saxon extension functions need to know if the output format +is HTML ('html') or XSL Formatting Objects ('fo'). This variable answers +that question. Valid settings are 'html' or 'fo'.</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="nominal.table.width" select="'6in'" doc:type='length'/> + +<doc:param name="nominal.table.width" xmlns=""> +<refpurpose>The (absolute) nominal width of tables</refpurpose> +<refdescription> +<para>In order to convert CALS column widths into HTML column widths, it +is sometimes necessary to have an absolute table width to use for conversion +of mixed absolute and relative widths. This value must be an absolute +length (not a percentag).</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="default.table.width" select="''" doc:type='length'/> + +<doc:param name="default.table.width" xmlns=""> +<refpurpose>The default width of tables</refpurpose> +<refdescription> +<para>If specified, this value will be used for the WIDTH attribute on +tables that do not specify an alternate width (with the dbhtml processing +instruction).</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="saxon.tablecolumns" select="'1'" doc:type='boolean'/> + +<doc:param name="saxon.tablecolumns" xmlns=""> +<refpurpose>Enable the table columns extension function</refpurpose> +<refdescription> +<para>The table columns extension function adjusts the widths of table +columns in the HTML result to more accurately reflect the specifications +in the CALS table. +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="generate.set.toc" select='1' doc:type='boolean'/> + +<doc:param name="" xmlns=""> +<refpurpose>FIXME:</refpurpose> +<refdescription> +<para>FIXME: +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="generate.book.toc" select='1' doc:type='boolean'/> + +<doc:param name="" xmlns=""> +<refpurpose>FIXME:</refpurpose> +<refdescription> +<para>FIXME: +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="generate.part.toc" select='1' doc:type='boolean'/> + +<doc:param name="" xmlns=""> +<refpurpose>FIXME:</refpurpose> +<refdescription> +<para>FIXME: +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="generate.reference.toc" select='1' doc:type='boolean'/> + +<doc:param name="" xmlns=""> +<refpurpose>FIXME:</refpurpose> +<refdescription> +<para>FIXME: +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="generate.preface.toc" select='1' doc:type='boolean'/> + +<doc:param name="" xmlns=""> +<refpurpose>FIXME:</refpurpose> +<refdescription> +<para>FIXME: +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="generate.chapter.toc" select='1' doc:type='boolean'/> + +<doc:param name="" xmlns=""> +<refpurpose>FIXME:</refpurpose> +<refdescription> +<para>FIXME: +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="generate.appendix.toc" select='1' doc:type='boolean'/> + +<doc:param name="" xmlns=""> +<refpurpose>FIXME:</refpurpose> +<refdescription> +<para>FIXME: +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="generate.article.toc" select='1' doc:type='boolean'/> + +<doc:param name="" xmlns=""> +<refpurpose>FIXME:</refpurpose> +<refdescription> +<para>FIXME: +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="generate.section.toc" select='0' doc:type='boolean'/> + +<doc:param name="" xmlns=""> +<refpurpose>FIXME:</refpurpose> +<refdescription> +<para>FIXME: +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> +<xsl:param name="generate.index" select='1' doc:type='boolean'/> + +<doc:param name="" xmlns=""> +<refpurpose>FIXME:</refpurpose> +<refdescription> +<para>FIXME: +</para> +</refdescription> +</doc:param> + +<!-- ==================================================================== --> + +</xsl:stylesheet> diff --git a/tests/docbook/html/pi.xsl b/tests/docbook/html/pi.xsl new file mode 100644 index 00000000..b9220aa9 --- /dev/null +++ b/tests/docbook/html/pi.xsl @@ -0,0 +1,191 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<xsl:template match="processing-instruction()"> +</xsl:template> + +<xsl:template match="processing-instruction('dbhtml')"> + <xsl:if test="$using.chunker"> + <xsl:processing-instruction name="dbhtml"> + <xsl:value-of select="."/> + </xsl:processing-instruction> + </xsl:if> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template name="dbhtml-attribute"> + <xsl:param name="pis" select="processing-instruction('dbhtml')"/> + <xsl:param name="attribute">filename</xsl:param> + <xsl:param name="count">1</xsl:param> + + <xsl:choose> + <xsl:when test="$count>count($pis)"> + <!-- not found --> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="pi"> + <xsl:value-of select="$pis[$count]"/> + </xsl:variable> + <xsl:choose> + <xsl:when test="contains($pi,concat($attribute, '='))"> + <xsl:variable name="rest" select="substring-after($pi,concat($attribute,'='))"/> + <xsl:variable name="quote" select="substring($rest,1,1)"/> + <xsl:value-of select="substring-before(substring($rest,2),$quote)"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="dbhtml-attribute"> + <xsl:with-param name="pis" select="$pis"/> + <xsl:with-param name="attribute" select="$attribute"/> + <xsl:with-param name="count" select="$count + 1"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="dbhtml-filename"> + <xsl:param name="pis" select="./processing-instruction('dbhtml')"/> + <xsl:call-template name="dbhtml-attribute"> + <xsl:with-param name="pis" select="$pis"/> + <xsl:with-param name="attribute">filename</xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template name="dbhtml-dir"> + <xsl:param name="pis" select="./processing-instruction('dbhtml')"/> + <xsl:call-template name="dbhtml-attribute"> + <xsl:with-param name="pis" select="$pis"/> + <xsl:with-param name="attribute">dir</xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template name="process.cmdsynopsis.list"> + <xsl:param name="cmdsynopses"/><!-- empty node list by default --> + <xsl:param name="count" select="1"/> + + <xsl:choose> + <xsl:when test="$count>count($cmdsynopses)"></xsl:when> + <xsl:otherwise> + <xsl:variable name="cmdsyn" select="$cmdsynopses[$count]"/> + + <dt> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select="$cmdsyn"/> + </xsl:call-template> + </xsl:attribute> + + <xsl:choose> + <xsl:when test="$cmdsyn/@xreflabel"> + <xsl:call-template name="xref.xreflabel"> + <xsl:with-param name="target" select="$cmdsyn"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="$cmdsyn" mode="xref-to"> + <xsl:with-param name="target" select="$cmdsyn"/> + </xsl:apply-templates> + </xsl:otherwise> + </xsl:choose> + </a> + </dt> + + <xsl:call-template name="process.cmdsynopsis.list"> + <xsl:with-param name="cmdsynopses" select="$cmdsynopses"/> + <xsl:with-param name="count" select="$count+1"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="processing-instruction('dbcmdlist')"> + <xsl:variable name="cmdsynopses" select="..//cmdsynopsis"/> + + <xsl:if test="count($cmdsynopses)<1"> + <xsl:message><xsl:text>No cmdsynopsis elements matched dbcmdlist PI, perhaps it's nested too deep?</xsl:text> + </xsl:message> + </xsl:if> + + <dl> + <xsl:call-template name="process.cmdsynopsis.list"> + <xsl:with-param name="cmdsynopses" select="$cmdsynopses"/> + </xsl:call-template> + </dl> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template name="process.funcsynopsis.list"> + <xsl:param name="funcsynopses"/><!-- empty node list by default --> + <xsl:param name="count" select="1"/> + + <xsl:choose> + <xsl:when test="$count>count($funcsynopses)"></xsl:when> + <xsl:otherwise> + <xsl:variable name="cmdsyn" select="$funcsynopses[$count]"/> + + <dt> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select="$cmdsyn"/> + </xsl:call-template> + </xsl:attribute> + + <xsl:choose> + <xsl:when test="$cmdsyn/@xreflabel"> + <xsl:call-template name="xref.xreflabel"> + <xsl:with-param name="target" select="$cmdsyn"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="$cmdsyn" mode="xref-to"> + <xsl:with-param name="target" select="$cmdsyn"/> + </xsl:apply-templates> + </xsl:otherwise> + </xsl:choose> + </a> + </dt> + + <xsl:call-template name="process.funcsynopsis.list"> + <xsl:with-param name="funcsynopses" select="$funcsynopses"/> + <xsl:with-param name="count" select="$count+1"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="processing-instruction('dbfunclist')"> + <xsl:variable name="funcsynopses" select="..//funcsynopsis"/> + + <xsl:if test="count($funcsynopses)<1"> + <xsl:message><xsl:text>No funcsynopsis elements matched dbfunclist PI, perhaps it's nested too deep?</xsl:text> + </xsl:message> + </xsl:if> + + <dl> + <xsl:call-template name="process.funcsynopsis.list"> + <xsl:with-param name="funcsynopses" select="$funcsynopses"/> + </xsl:call-template> + </dl> +</xsl:template> + +<!-- ==================================================================== --> + +</xsl:stylesheet> diff --git a/tests/docbook/html/qandaset.xsl b/tests/docbook/html/qandaset.xsl new file mode 100644 index 00000000..bdbfea1a --- /dev/null +++ b/tests/docbook/html/qandaset.xsl @@ -0,0 +1,202 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" + exclude-result-prefixes="doc" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<!-- ==================================================================== --> + +<xsl:template match="qandaset"> + <xsl:variable name="title" select="title"/> + <xsl:variable name="rest" select="*[name(.)!='title']"/> + + <div class="{name(.)}"> + <xsl:apply-templates select="$title"/> + <xsl:if test="$generate.qandaset.toc != '0'"> + <xsl:call-template name="process.qanda.toc"/> + </xsl:if> + <xsl:apply-templates select="$rest"/> + </div> +</xsl:template> + +<xsl:template match="qandaset/title"> + <xsl:variable name="qalevel"> + <xsl:call-template name="qanda.section.level"/> + </xsl:variable> + <xsl:element name="h{string(number($qalevel)+1)}"> + <xsl:attribute name="class"> + <xsl:value-of select="name(.)"/> + </xsl:attribute> + <xsl:apply-templates/> + </xsl:element> +</xsl:template> + +<xsl:template match="qandadiv"> + <xsl:variable name="title" select="title"/> + <xsl:variable name="rest" select="*[name(.)!='title']"/> + + <div class="{name(.)}"> + <xsl:apply-templates select="$title"/> + <xsl:if test="$generate.qandadiv.toc != '0'"> + <xsl:call-template name="process.qanda.toc"/> + </xsl:if> + <xsl:apply-templates select="$rest"/> + </div> +</xsl:template> + +<xsl:template match="qandadiv/title"> + <xsl:variable name="qalevel"> + <xsl:call-template name="qandadiv.section.level"/> + </xsl:variable> + <xsl:variable name="id"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select="parent::*"/> + </xsl:call-template> + </xsl:variable> + + <xsl:element name="h{string(number($qalevel)+1)}"> + <xsl:attribute name="class"> + <xsl:value-of select="name(.)"/> + </xsl:attribute> + <a name="{$id}"> + <xsl:apply-templates select="parent::qandadiv" mode="label.content"/> + <xsl:text> </xsl:text> + <xsl:apply-templates/> + </a> + </xsl:element> +</xsl:template> + +<xsl:template match="qandaentry"> + <div class="{name(.)}"> + <xsl:apply-templates/> + </div> +</xsl:template> + +<xsl:template match="question"> + <xsl:variable name="firstch" select="(*[name(.)!='label'])[1]"/> + <xsl:variable name="restch" select="(*[name(.)!='label'])[position()!=1]"/> + <xsl:variable name="id"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select="parent::*"/> + </xsl:call-template> + </xsl:variable> + + <div class="{name(.)}"> + <p> + <a name="{$id}"> + <b> + <xsl:apply-templates select="." mode="label.content"/> + <xsl:text> </xsl:text> + </b> + <xsl:apply-templates select="$firstch" mode="no.wrapper.mode"/> + </a> + </p> + <xsl:apply-templates select="$restch"/> + </div> +</xsl:template> + +<xsl:template match="answer"> + <xsl:variable name="firstch" select="(*[name(.)!='label'])[1]"/> + <xsl:variable name="restch" select="(*[name(.)!='label'])[position()!=1]"/> + + <div class="{name(.)}"> + <p> + <b> + <xsl:apply-templates select="." mode="label.content"/> + <xsl:text> </xsl:text> + </b> + <xsl:apply-templates select="$firstch" mode="no.wrapper.mode"/> + </p> + <xsl:apply-templates select="$restch"/> + </div> +</xsl:template> + +<xsl:template match="label"> + <xsl:apply-templates/> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template name="process.qanda.toc"> + <dl> + <xsl:apply-templates select="qandadiv" mode="qandatoc.mode"/> + <xsl:apply-templates select="qandaentry" mode="qandatoc.mode"/> + </dl> +</xsl:template> + +<xsl:template match="qandadiv" mode="qandatoc.mode"> + <dt><xsl:apply-templates select="title" mode="qandatoc.mode"/></dt> + <dd><xsl:call-template name="process.qanda.toc"/></dd> +</xsl:template> + +<xsl:template match="qandadiv/title" mode="qandatoc.mode"> + <xsl:variable name="qalevel"> + <xsl:call-template name="qandadiv.section.level"/> + </xsl:variable> + <xsl:variable name="id"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select="parent::*"/> + </xsl:call-template> + </xsl:variable> + + <xsl:apply-templates select="parent::qandadiv" mode="label.content"/> + <xsl:text> </xsl:text> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="parent::*"/> + </xsl:call-template> + </xsl:attribute> + <xsl:apply-templates/> + </a> +</xsl:template> + +<xsl:template match="qandaentry" mode="qandatoc.mode"> + <xsl:apply-templates mode="qandatoc.mode"/> +</xsl:template> + +<xsl:template match="question" mode="qandatoc.mode"> + <xsl:variable name="firstch" select="(*[name(.)!='label'])[1]"/> + <xsl:variable name="id"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select="parent::*"/> + </xsl:call-template> + </xsl:variable> + + <dt> + <xsl:apply-templates select="." mode="label.content"/> + <xsl:text> </xsl:text> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="parent::*"/> + </xsl:call-template> + </xsl:attribute> + <xsl:value-of select="$firstch"/> + </a> + </dt> +</xsl:template> + +<xsl:template match="answer|revhistory" mode="qandatoc.mode"> + <!-- nop --> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="*" mode="no.wrapper.mode"> + <xsl:apply-templates/> +</xsl:template> + +<!-- ==================================================================== --> + +</xsl:stylesheet> diff --git a/tests/docbook/html/refentry.xsl b/tests/docbook/html/refentry.xsl new file mode 100644 index 00000000..0d8dc366 --- /dev/null +++ b/tests/docbook/html/refentry.xsl @@ -0,0 +1,212 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<!-- ==================================================================== --> + +<xsl:template match="reference"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + + <div class="{name(.)}"> + <xsl:if test="@id"> + <a name="{$id}"/> + </xsl:if> + <xsl:call-template name="reference.titlepage"/> + <xsl:if test="not(partintro) and $generate.reference.toc != '0'"> + <xsl:call-template name="division.toc"/> + </xsl:if> + <xsl:apply-templates/> + </div> +</xsl:template> + +<xsl:template match="reference" mode="division.number"> + <xsl:number from="book" count="reference" format="I."/> +</xsl:template> + +<xsl:template match="reference/docinfo"></xsl:template> +<xsl:template match="reference/referenceinfo"></xsl:template> +<xsl:template match="reference/title"></xsl:template> +<xsl:template match="reference/subtitle"></xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="refentry"> + <xsl:variable name="refmeta" select=".//refmeta"/> + <xsl:variable name="refentrytitle" select="$refmeta//refentrytitle"/> + <xsl:variable name="refnamediv" select=".//refnamediv"/> + <xsl:variable name="refname" select="$refnamediv//refname"/> + <xsl:variable name="title"> + <xsl:choose> + <xsl:when test="$refentrytitle"> + <xsl:apply-templates select="$refentrytitle[1]" mode="title"/> + </xsl:when> + <xsl:when test="$refname"> + <xsl:apply-templates select="$refname[1]" mode="title"/> + </xsl:when> + <xsl:otherwise></xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <div class="{name(.)}"> + <h1 class="title"> + <a> + <xsl:attribute name="name"> + <xsl:call-template name="object.id"/> + </xsl:attribute> + </a> + <xsl:copy-of select="$title"/> + </h1> + <xsl:apply-templates/> + <xsl:call-template name="process.footnotes"/> + </div> +</xsl:template> + +<xsl:template match="refentry/docinfo|refentry/refentryinfo"></xsl:template> + +<xsl:template match="refentrytitle|refname" mode="title"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="refmeta"> +</xsl:template> + +<xsl:template match="manvolnum"> + <xsl:if test="$refentry.xref.manvolnum != 0"> + <xsl:text>(</xsl:text> + <xsl:apply-templates/> + <xsl:text>)</xsl:text> + </xsl:if> +</xsl:template> + +<xsl:template match="refmiscinfo"> +</xsl:template> + +<xsl:template match="refentrytitle"> + <xsl:call-template name="inline.charseq"/> +</xsl:template> + +<xsl:template match="refnamediv"> + <xsl:call-template name="block.object"/> +</xsl:template> + +<xsl:template match="refname"> + <xsl:apply-templates/> + <xsl:if test="following-sibling::refname"> + <xsl:text>, </xsl:text> + </xsl:if> +</xsl:template> + +<xsl:template match="refname[1]"> + <xsl:if test="$refentry.generate.name != 0"> + <h2><xsl:call-template name="gentext.element.name"/></h2> + </xsl:if> + <xsl:apply-templates/> + <xsl:if test="following-sibling::refname"> + <xsl:text>, </xsl:text> + </xsl:if> +</xsl:template> + +<xsl:template match="refpurpose"> + <xsl:text> </xsl:text> + <xsl:call-template name="dingbat"> + <xsl:with-param name="dingbat">em-dash</xsl:with-param> + </xsl:call-template> + <xsl:text> </xsl:text> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="refdescriptor"> + <!-- todo: finish this --> +</xsl:template> + +<xsl:template match="refclass"> + <p> + <b> + <xsl:if test="@role"> + <xsl:value-of select="@role"/> + <xsl:text>: </xsl:text> + </xsl:if> + <xsl:apply-templates/> + </b> + </p> +</xsl:template> + +<xsl:template match="refsynopsisdiv"> + <div class="{name(.)}"> + <a> + <xsl:attribute name="name"> + <xsl:call-template name="object.id"/> + </xsl:attribute> + </a> + <h2>Synopsis</h2> + <xsl:apply-templates/> + </div> +</xsl:template> + +<xsl:template match="refsynopsisdivinfo"></xsl:template> + +<xsl:template match="refsynopsisdiv/title"> +</xsl:template> + +<xsl:template match="refsect1|refsect2|refsect3"> + <xsl:call-template name="block.object"/> +</xsl:template> + +<xsl:template match="refsect1/title"> + <h2> + <a> + <xsl:attribute name="name"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select="ancestor::refsect1"/> + </xsl:call-template> + </xsl:attribute> + </a> + <xsl:apply-templates/> + </h2> +</xsl:template> + +<xsl:template match="refsect2/title"> + <h3> + <a> + <xsl:attribute name="name"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select="ancestor::refsect2"/> + </xsl:call-template> + </xsl:attribute> + </a> + <xsl:apply-templates/> + </h3> +</xsl:template> + +<xsl:template match="refsect3/title"> + <h4> + <a> + <xsl:attribute name="name"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select="ancestor::refsect3"/> + </xsl:call-template> + </xsl:attribute> + </a> + <xsl:apply-templates/> + </h4> +</xsl:template> + +<xsl:template match="refsect1info"></xsl:template> +<xsl:template match="refsect2info"></xsl:template> +<xsl:template match="refsect3info"></xsl:template> + +<!-- ==================================================================== --> + +</xsl:stylesheet> diff --git a/tests/docbook/html/sections.xsl b/tests/docbook/html/sections.xsl new file mode 100644 index 00000000..ea7eb226 --- /dev/null +++ b/tests/docbook/html/sections.xsl @@ -0,0 +1,236 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<!-- ==================================================================== --> + +<xsl:template match="section"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + + <div class="{name(.)}"> + <a name="{$id}"/> + <xsl:call-template name="section.titlepage"/> + <xsl:if test="$generate.section.toc != '0' + or refentry"> + <xsl:call-template name="section.toc"/> + </xsl:if> + <xsl:apply-templates/> + </div> +</xsl:template> + +<xsl:template match="title" mode="section.titlepage.recto.mode"> + <xsl:variable name="section" select="(ancestor::section + |ancestor::simplesect + |ancestor::sect1 + |ancestor::sect2 + |ancestor::sect3 + |ancestor::sect4 + |ancestor::sect5)[last()]"/> + <xsl:call-template name="section.heading"> + <xsl:with-param name="section" select="$section"/> + <xsl:with-param name="level"> + <xsl:call-template name="section.level"> + <xsl:with-param name="node" select="$section"/> + </xsl:call-template> + </xsl:with-param> + <xsl:with-param name="title"> + <xsl:apply-templates select="$section" mode="title.ref"> + <xsl:with-param name="label-wrapper" select="'span'"/> + <xsl:with-param name="label-wrapper-class" select="'label'"/> + <xsl:with-param name="title-wrapper" select="'span'"/> + <xsl:with-param name="title-wrapper-class" select="'title'"/> + <xsl:with-param name="allow-anchors" select="'1'"/> + </xsl:apply-templates> + </xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="sect1"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + + <div class="{name(.)}"> + <a name="{$id}"/> + <xsl:call-template name="sect1.titlepage"/> + <xsl:if test="$generate.section.toc != '0' + or refentry"> + <xsl:call-template name="section.toc"/> + </xsl:if> + <xsl:apply-templates/> + </div> +</xsl:template> + +<xsl:template match="title" mode="sect1.titlepage.recto.mode"> + <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> +</xsl:template> + +<xsl:template match="sect2"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + + <div class="{name(.)}"> + <a name="{$id}"/> + <xsl:call-template name="sect2.titlepage"/> + <xsl:if test="$generate.section.toc != '0' + or refentry"> + <xsl:call-template name="section.toc"/> + </xsl:if> + <xsl:apply-templates/> + </div> +</xsl:template> + +<xsl:template match="title" mode="sect2.titlepage.recto.mode"> + <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> +</xsl:template> + +<xsl:template match="sect3"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + + <div class="{name(.)}"> + <a name="{$id}"/> + <xsl:call-template name="sect3.titlepage"/> + + <xsl:if test="$generate.section.toc != '0' + or refentry"> + <xsl:call-template name="section.toc"/> + </xsl:if> + <xsl:apply-templates/> + </div> +</xsl:template> + +<xsl:template match="title" mode="sect3.titlepage.recto.mode"> + <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> +</xsl:template> + +<xsl:template match="sect4"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + + <div class="{name(.)}"> + <a name="{$id}"/> + <xsl:call-template name="sect4.titlepage"/> + <xsl:if test="$generate.section.toc != '0' + or refentry"> + <xsl:call-template name="section.toc"/> + </xsl:if> + <xsl:apply-templates/> + </div> +</xsl:template> + +<xsl:template match="title" mode="sect4.titlepage.recto.mode"> + <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> +</xsl:template> + +<xsl:template match="sect5"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + + <div class="{name(.)}"> + <a name="{$id}"/> + <xsl:call-template name="sect5.titlepage"/> + <xsl:if test="$generate.section.toc != '0' + or refentry"> + <xsl:call-template name="section.toc"/> + </xsl:if> + <xsl:apply-templates/> + </div> +</xsl:template> + +<xsl:template match="title" mode="sect5.titlepage.recto.mode"> + <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> +</xsl:template> + +<xsl:template match="simplesect"> + <xsl:variable name="id"> + <xsl:call-template name="object.id"/> + </xsl:variable> + + <div class="{name(.)}"> + <a name="{$id}"/> + <xsl:call-template name="simplesect.titlepage"/> + <xsl:apply-templates/> + </div> +</xsl:template> + +<xsl:template match="title" mode="simplesect.titlepage.recto.mode"> + <xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> +</xsl:template> + +<xsl:template match="section/title"></xsl:template> +<xsl:template match="section/subtitle"></xsl:template> +<xsl:template match="sectioninfo"></xsl:template> + +<xsl:template match="sect1/title"></xsl:template> +<xsl:template match="sect1/subtitle"></xsl:template> +<xsl:template match="sect1info"></xsl:template> + +<xsl:template match="sect2/title"></xsl:template> +<xsl:template match="sect2/subtitle"></xsl:template> +<xsl:template match="sect2info"></xsl:template> + +<xsl:template match="sect3/title"></xsl:template> +<xsl:template match="sect3/subtitle"></xsl:template> +<xsl:template match="sect3info"></xsl:template> + +<xsl:template match="sect4/title"></xsl:template> +<xsl:template match="sect4/subtitle"></xsl:template> +<xsl:template match="sect4info"></xsl:template> + +<xsl:template match="sect5/title"></xsl:template> +<xsl:template match="sect5/subtitle"></xsl:template> +<xsl:template match="sect5info"></xsl:template> + +<xsl:template match="simplesect/title"></xsl:template> +<xsl:template match="simplesect/subtitle"></xsl:template> + +<!-- ==================================================================== --> + +<xsl:template name="section.heading"> + <xsl:param name="section" select="."/> + <xsl:param name="level" select="'1'"/> + <xsl:param name="title"/> + <xsl:element name="h{$level}"> + <xsl:attribute name="class">title</xsl:attribute> + <xsl:if test="$css.decoration != '0'"> + <xsl:if test="$level<3"> + <xsl:attribute name="style">clear: all</xsl:attribute> + </xsl:if> + </xsl:if> + <a> + <xsl:attribute name="name"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select="$section"/> + </xsl:call-template> + </xsl:attribute> + </a> + <xsl:copy-of select="$title"/> + </xsl:element> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="bridgehead"> + <!-- need to calculate depth! --> + <h3><xsl:apply-templates/></h3> +</xsl:template> + +</xsl:stylesheet> + diff --git a/tests/docbook/html/synop.xsl b/tests/docbook/html/synop.xsl new file mode 100644 index 00000000..9c0f30d7 --- /dev/null +++ b/tests/docbook/html/synop.xsl @@ -0,0 +1,939 @@ +<?xml version='1.0'?> +<!DOCTYPE xsl:stylesheet [ +<!ENTITY RE " "> +<!ENTITY nbsp " "> +]> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<!-- ==================================================================== --> + +<!-- synopsis is in verbatim --> + +<!-- ==================================================================== --> + +<xsl:template match="cmdsynopsis"> + <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable> + + <div class="{name(.)}" id="{$id}"> + <a name="{$id}"/> + <xsl:apply-templates/> + </div> +</xsl:template> + +<xsl:template match="cmdsynopsis/command"> + <br/> + <xsl:call-template name="inline.monoseq"/> + <xsl:text> </xsl:text> +</xsl:template> + +<xsl:template match="cmdsynopsis/command[1]" priority="2"> + <xsl:call-template name="inline.monoseq"/> + <xsl:text> </xsl:text> +</xsl:template> + +<xsl:template match="group|arg"> + <xsl:variable name="choice" select="@choice"/> + <xsl:variable name="rep" select="@rep"/> + <xsl:variable name="sepchar"> + <xsl:choose> + <xsl:when test="ancestor-or-self::*/@sepchar"> + <xsl:value-of select="ancestor-or-self::*/@sepchar"/> + </xsl:when> + <xsl:otherwise> + <xsl:text> </xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:if test="position()>1"><xsl:value-of select="$sepchar"/></xsl:if> + <xsl:choose> + <xsl:when test="$choice='plain'"> + <xsl:value-of select="$arg.choice.plain.open.str"/> + </xsl:when> + <xsl:when test="$choice='req'"> + <xsl:value-of select="$arg.choice.req.open.str"/> + </xsl:when> + <xsl:when test="$choice='opt'"> + <xsl:value-of select="$arg.choice.opt.open.str"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$arg.choice.def.open.str"/> + </xsl:otherwise> + </xsl:choose> + <xsl:apply-templates/> + <xsl:choose> + <xsl:when test="$rep='repeat'"> + <xsl:value-of select="$arg.rep.repeat.str"/> + </xsl:when> + <xsl:when test="$rep='norepeat'"> + <xsl:value-of select="$arg.rep.norepeat.str"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$arg.rep.def.str"/> + </xsl:otherwise> + </xsl:choose> + <xsl:choose> + <xsl:when test="$choice='plain'"> + <xsl:value-of select="$arg.choice.plain.close.str"/> + </xsl:when> + <xsl:when test="$choice='req'"> + <xsl:value-of select="$arg.choice.req.close.str"/> + </xsl:when> + <xsl:when test="$choice='opt'"> + <xsl:value-of select="$arg.choice.opt.close.str"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$arg.choice.def.close.str"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="group/arg"> + <xsl:variable name="choice" select="@choice"/> + <xsl:variable name="rep" select="@rep"/> + <xsl:if test="position()>1"><xsl:value-of select="$arg.or.sep"/></xsl:if> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="sbr"> + <br/> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="synopfragmentref"> + <xsl:variable name="target" select="id(@linkend)"/> + <xsl:variable name="snum"> + <xsl:apply-templates select="$target" mode="synopfragment.number"/> + </xsl:variable> + <i> + <a href="{@linkend}"> + <xsl:text>(</xsl:text> + <xsl:value-of select="$snum"/> + <xsl:text>)</xsl:text> + </a> + </i> +</xsl:template> + +<xsl:template match="synopfragment" mode="synopfragment.number"> + <xsl:number format="1"/> +</xsl:template> + +<xsl:template match="synopfragment"> + <xsl:variable name="snum"> + <xsl:apply-templates select="." mode="synopfragment.number"/> + </xsl:variable> + <p> + <a name="#{@id}"> + <xsl:text>(</xsl:text> + <xsl:value-of select="$snum"/> + <xsl:text>)</xsl:text> + </a> + <xsl:text> </xsl:text> + <xsl:apply-templates/> + </p> +</xsl:template> + +<xsl:template match="funcsynopsis"> + <xsl:call-template name="informal.object"/> +</xsl:template> + +<xsl:template match="funcsynopsisinfo"> + <pre class="{name(.)}"><xsl:apply-templates/></pre> +</xsl:template> + +<xsl:template match="funcprototype"> + <p> + <code> + <xsl:apply-templates/> + <xsl:if test="$funcsynopsis.style='kr'"> + <xsl:apply-templates select="./paramdef" mode="kr-funcsynopsis-mode"/> + </xsl:if> + </code> + </p> +</xsl:template> + +<xsl:template match="funcdef"> + <code class="{name(.)}"> + <xsl:apply-templates/> + </code> +</xsl:template> + +<xsl:template match="funcdef/function"> + <xsl:choose> + <xsl:when test="$funcsynopsis.decoration != 0"> + <b class="fsfunc"><xsl:apply-templates/></b> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="void"> + <xsl:choose> + <xsl:when test="$funcsynopsis.style='ansi'"> + <xsl:text>(void);</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>();</xsl:text> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="varargs"> + <xsl:text>(...);</xsl:text> +</xsl:template> + +<xsl:template match="paramdef"> + <xsl:variable name="paramnum"> + <xsl:number count="paramdef" format="1"/> + </xsl:variable> + <xsl:if test="$paramnum=1">(</xsl:if> + <xsl:choose> + <xsl:when test="$funcsynopsis.style='ansi'"> + <xsl:apply-templates/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="./parameter"/> + </xsl:otherwise> + </xsl:choose> + <xsl:choose> + <xsl:when test="following-sibling::paramdef"> + <xsl:text>, </xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>);</xsl:text> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="paramdef/parameter"> + <xsl:choose> + <xsl:when test="$funcsynopsis.decoration != 0"> + <var class="pdparam"> + <xsl:apply-templates/> + </var> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> + <xsl:if test="following-sibling::parameter"> + <xsl:text>, </xsl:text> + </xsl:if> +</xsl:template> + +<xsl:template match="paramdef" mode="kr-funcsynopsis-mode"> + <br/> + <xsl:apply-templates/> + <xsl:text>;</xsl:text> +</xsl:template> + +<xsl:template match="funcparams"> + <xsl:text>(</xsl:text> + <xsl:apply-templates/> + <xsl:text>)</xsl:text> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:variable name="default-classsynopsis-language">java</xsl:variable> + +<xsl:template match="classsynopsis"> + <xsl:param name="language"> + <xsl:choose> + <xsl:when test="@language"> + <xsl:value-of select="@language"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$default-classsynopsis-language"/> + </xsl:otherwise> + </xsl:choose> + </xsl:param> + + <xsl:choose> + <xsl:when test="$language='java'"> + <xsl:apply-templates select="." mode="java"/> + </xsl:when> + <xsl:when test="$language='perl'"> + <xsl:apply-templates select="." mode="perl"/> + </xsl:when> + <xsl:when test="$language='idl'"> + <xsl:apply-templates select="." mode="idl"/> + </xsl:when> + <xsl:when test="$language='cpp'"> + <xsl:apply-templates select="." mode="cpp"/> + </xsl:when> + <xsl:otherwise> + <xsl:message> + <xsl:text>Unrecognized language on classsynopsis: </xsl:text> + <xsl:value-of select="$language"/> + </xsl:message> + <xsl:apply-templates select="."> + <xsl:with-param name="language" + select="$default-classsynopsis-language"/> + </xsl:apply-templates> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- ===== Java ======================================================== --> + +<xsl:template match="classsynopsis" mode="java"> + <pre class="{name(.)}"> + <xsl:apply-templates select="ooclass[1]" mode="java"/> + <xsl:if test="ooclass[position() > 1]"> + <xsl:text> extends</xsl:text> + <xsl:apply-templates select="ooclass[position() > 1]" mode="java"/> + <xsl:if test="oointerface|ooexception"> + <xsl:text>&RE; </xsl:text> + </xsl:if> + </xsl:if> + <xsl:if test="oointerface"> + <xsl:text>implements</xsl:text> + <xsl:apply-templates select="oointerface" mode="java"/> + <xsl:if test="ooexception"> + <xsl:text>&RE; </xsl:text> + </xsl:if> + </xsl:if> + <xsl:if test="ooexception"> + <xsl:text>throws</xsl:text> + <xsl:apply-templates select="ooexception" mode="java"/> + </xsl:if> + <xsl:text> {&RE;&RE;</xsl:text> + <xsl:apply-templates select="constructorsynopsis + |destructorsynopsis + |fieldsynopsis + |methodsynopsis + |classsynopsisinfo" mode="java"/> + <xsl:text>}</xsl:text> + </pre> +</xsl:template> + +<xsl:template match="classsynopsisinfo" mode="java"> + <xsl:apply-templates mode="java"/> +</xsl:template> + +<xsl:template match="ooclass|oointerface|ooexception" mode="java"> + <xsl:choose> + <xsl:when test="position() > 1"> + <xsl:text>, </xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text> </xsl:text> + </xsl:otherwise> + </xsl:choose> + <span class="{name(.)}"> + <xsl:apply-templates mode="java"/> + </span> +</xsl:template> + +<xsl:template match="modifier" mode="java"> + <span class="{name(.)}"> + <xsl:apply-templates mode="java"/> + <xsl:text> </xsl:text> + </span> +</xsl:template> + +<xsl:template match="classname" mode="java"> + <xsl:if test="name(preceding-sibling::*[1]) = 'classname'"> + <xsl:text>, </xsl:text> + </xsl:if> + <span class="{name(.)}"> + <xsl:apply-templates mode="java"/> + </span> +</xsl:template> + +<xsl:template match="interfacename" mode="java"> + <xsl:if test="name(preceding-sibling::*[1]) = 'interfacename'"> + <xsl:text>, </xsl:text> + </xsl:if> + <span class="{name(.)}"> + <xsl:apply-templates mode="java"/> + </span> +</xsl:template> + +<xsl:template match="exceptionname" mode="java"> + <xsl:if test="name(preceding-sibling::*[1]) = 'exceptionname'"> + <xsl:text>, </xsl:text> + </xsl:if> + <span class="{name(.)}"> + <xsl:apply-templates mode="java"/> + </span> +</xsl:template> + +<xsl:template match="fieldsynopsis" mode="java"> + <div class="{name(.)}"> + <xsl:text> </xsl:text> + <xsl:apply-templates mode="java"/> + <xsl:text>;</xsl:text> + </div> +</xsl:template> + +<xsl:template match="type" mode="java"> + <span class="{name(.)}"> + <xsl:apply-templates mode="java"/> + <xsl:text> </xsl:text> + </span> +</xsl:template> + +<xsl:template match="varname" mode="java"> + <span class="{name(.)}"> + <xsl:apply-templates mode="java"/> + <xsl:text> </xsl:text> + </span> +</xsl:template> + +<xsl:template match="initializer" mode="java"> + <span class="{name(.)}"> + <xsl:text>= </xsl:text> + <xsl:apply-templates mode="java"/> + </span> +</xsl:template> + +<xsl:template match="void" mode="java"> + <span class="{name(.)}"> + <xsl:text>void </xsl:text> + </span> +</xsl:template> + +<xsl:template match="methodname" mode="java"> + <span class="{name(.)}"> + <xsl:apply-templates mode="java"/> + </span> +</xsl:template> + +<xsl:template match="methodparam" mode="java"> + <xsl:param name="indent">0</xsl:param> + <xsl:if test="position() > 1"> + <xsl:text>,&RE;</xsl:text> + <xsl:if test="$indent > 0"> + <xsl:call-template name="copy-string"> + <xsl:with-param name="string"> </xsl:with-param> + <xsl:with-param name="count" select="$indent + 1"/> + </xsl:call-template> + </xsl:if> + </xsl:if> + <span class="{name(.)}"> + <xsl:apply-templates mode="java"/> + </span> +</xsl:template> + +<xsl:template match="parameter" mode="java"> + <span class="{name(.)}"> + <xsl:apply-templates mode="java"/> + </span> +</xsl:template> + +<xsl:template mode="java" + match="constructorsynopsis|destructorsynopsis|methodsynopsis"> + <xsl:variable name="modifiers" select="modifier"/> + <xsl:variable name="notmod" select="*[name(.) != 'modifier']"/> + <xsl:variable name="decl"> + <xsl:text> </xsl:text> + <xsl:apply-templates select="$modifiers" mode="java"/> + + <!-- type --> + <xsl:if test="name($notmod[1]) != 'methodname'"> + <xsl:apply-templates select="$notmod[1]" mode="java"/> + </xsl:if> + + <xsl:apply-templates select="methodname" mode="java"/> + </xsl:variable> + + <div class="{name(.)}"> + <xsl:copy-of select="$decl"/> + <xsl:text>(</xsl:text> + <xsl:apply-templates select="methodparam" mode="java"> + <xsl:with-param name="indent" select="string-length($decl)"/> + </xsl:apply-templates> + <xsl:text>)</xsl:text> + <xsl:if test="exceptionname"> + <xsl:text>&RE; throws </xsl:text> + <xsl:apply-templates select="exceptionname" mode="java"/> + </xsl:if> + <xsl:text>;</xsl:text> + </div> +</xsl:template> + +<!-- ===== C++ ========================================================= --> + +<xsl:template match="classsynopsis" mode="cpp"> + <pre class="{name(.)}"> + <xsl:apply-templates select="ooclass[1]" mode="cpp"/> + <xsl:if test="ooclass[position() > 1]"> + <xsl:text>: </xsl:text> + <xsl:apply-templates select="ooclass[position() > 1]" mode="cpp"/> + <xsl:if test="oointerface|ooexception"> + <xsl:text>&RE; </xsl:text> + </xsl:if> + </xsl:if> + <xsl:if test="oointerface"> + <xsl:text> implements</xsl:text> + <xsl:apply-templates select="oointerface" mode="cpp"/> + <xsl:if test="ooexception"> + <xsl:text>&RE; </xsl:text> + </xsl:if> + </xsl:if> + <xsl:if test="ooexception"> + <xsl:text> throws</xsl:text> + <xsl:apply-templates select="ooexception" mode="cpp"/> + </xsl:if> + <xsl:text> {&RE;&RE;</xsl:text> + <xsl:apply-templates select="constructorsynopsis + |destructorsynopsis + |fieldsynopsis + |methodsynopsis + |classsynopsisinfo" mode="cpp"/> + <xsl:text>}</xsl:text> + </pre> +</xsl:template> + +<xsl:template match="classsynopsisinfo" mode="cpp"> + <xsl:apply-templates mode="cpp"/> +</xsl:template> + +<xsl:template match="ooclass|oointerface|ooexception" mode="cpp"> + <xsl:if test="position() > 1"> + <xsl:text>, </xsl:text> + </xsl:if> + <span class="{name(.)}"> + <xsl:apply-templates mode="cpp"/> + </span> +</xsl:template> + +<xsl:template match="modifier" mode="cpp"> + <span class="{name(.)}"> + <xsl:apply-templates mode="cpp"/> + <xsl:text> </xsl:text> + </span> +</xsl:template> + +<xsl:template match="classname" mode="cpp"> + <xsl:if test="name(preceding-sibling::*[1]) = 'classname'"> + <xsl:text>, </xsl:text> + </xsl:if> + <span class="{name(.)}"> + <xsl:apply-templates mode="cpp"/> + </span> +</xsl:template> + +<xsl:template match="interfacename" mode="cpp"> + <xsl:if test="name(preceding-sibling::*[1]) = 'interfacename'"> + <xsl:text>, </xsl:text> + </xsl:if> + <span class="{name(.)}"> + <xsl:apply-templates mode="cpp"/> + </span> +</xsl:template> + +<xsl:template match="exceptionname" mode="cpp"> + <xsl:if test="name(preceding-sibling::*[1]) = 'exceptionname'"> + <xsl:text>, </xsl:text> + </xsl:if> + <span class="{name(.)}"> + <xsl:apply-templates mode="cpp"/> + </span> +</xsl:template> + +<xsl:template match="fieldsynopsis" mode="cpp"> + <div class="{name(.)}"> + <xsl:text> </xsl:text> + <xsl:apply-templates mode="cpp"/> + <xsl:text>;</xsl:text> + </div> +</xsl:template> + +<xsl:template match="type" mode="cpp"> + <span class="{name(.)}"> + <xsl:apply-templates mode="cpp"/> + <xsl:text> </xsl:text> + </span> +</xsl:template> + +<xsl:template match="varname" mode="cpp"> + <span class="{name(.)}"> + <xsl:apply-templates mode="cpp"/> + <xsl:text> </xsl:text> + </span> +</xsl:template> + +<xsl:template match="initializer" mode="cpp"> + <span class="{name(.)}"> + <xsl:text>= </xsl:text> + <xsl:apply-templates mode="cpp"/> + </span> +</xsl:template> + +<xsl:template match="void" mode="cpp"> + <span class="{name(.)}"> + <xsl:text>void </xsl:text> + </span> +</xsl:template> + +<xsl:template match="methodname" mode="cpp"> + <span class="{name(.)}"> + <xsl:apply-templates mode="cpp"/> + </span> +</xsl:template> + +<xsl:template match="methodparam" mode="cpp"> + <xsl:if test="position() > 1"> + <xsl:text>, </xsl:text> + </xsl:if> + <span class="{name(.)}"> + <xsl:apply-templates mode="cpp"/> + </span> +</xsl:template> + +<xsl:template match="parameter" mode="cpp"> + <span class="{name(.)}"> + <xsl:apply-templates mode="cpp"/> + </span> +</xsl:template> + +<xsl:template mode="cpp" + match="constructorsynopsis|destructorsynopsis|methodsynopsis"> + <xsl:variable name="modifiers" select="modifier"/> + <xsl:variable name="notmod" select="*[name(.) != 'modifier']"/> + <xsl:variable name="type"> + </xsl:variable> + <div class="{name(.)}"> + <xsl:text> </xsl:text> + <xsl:apply-templates select="$modifiers" mode="cpp"/> + + <!-- type --> + <xsl:if test="name($notmod[1]) != 'methodname'"> + <xsl:apply-templates select="$notmod[1]" mode="cpp"/> + </xsl:if> + + <xsl:apply-templates select="methodname" mode="cpp"/> + <xsl:text>(</xsl:text> + <xsl:apply-templates select="methodparam" mode="cpp"/> + <xsl:text>)</xsl:text> + <xsl:if test="exceptionname"> + <xsl:text>&RE; throws </xsl:text> + <xsl:apply-templates select="exceptionname" mode="cpp"/> + </xsl:if> + <xsl:text>;</xsl:text> + </div> +</xsl:template> + +<!-- ===== IDL ========================================================= --> + +<xsl:template match="classsynopsis" mode="idl"> + <pre class="{name(.)}"> + <xsl:text>interface </xsl:text> + <xsl:apply-templates select="ooclass[1]" mode="idl"/> + <xsl:if test="ooclass[position() > 1]"> + <xsl:text>: </xsl:text> + <xsl:apply-templates select="ooclass[position() > 1]" mode="idl"/> + <xsl:if test="oointerface|ooexception"> + <xsl:text>&RE; </xsl:text> + </xsl:if> + </xsl:if> + <xsl:if test="oointerface"> + <xsl:text> implements</xsl:text> + <xsl:apply-templates select="oointerface" mode="idl"/> + <xsl:if test="ooexception"> + <xsl:text>&RE; </xsl:text> + </xsl:if> + </xsl:if> + <xsl:if test="ooexception"> + <xsl:text> throws</xsl:text> + <xsl:apply-templates select="ooexception" mode="idl"/> + </xsl:if> + <xsl:text> {&RE;&RE;</xsl:text> + <xsl:apply-templates select="constructorsynopsis + |destructorsynopsis + |fieldsynopsis + |methodsynopsis + |classsynopsisinfo" mode="idl"/> + <xsl:text>}</xsl:text> + </pre> +</xsl:template> + +<xsl:template match="classsynopsisinfo" mode="idl"> + <xsl:apply-templates mode="idl"/> +</xsl:template> + +<xsl:template match="ooclass|oointerface|ooexception" mode="idl"> + <xsl:if test="position() > 1"> + <xsl:text>, </xsl:text> + </xsl:if> + <span class="{name(.)}"> + <xsl:apply-templates mode="idl"/> + </span> +</xsl:template> + +<xsl:template match="modifier" mode="idl"> + <span class="{name(.)}"> + <xsl:apply-templates mode="idl"/> + <xsl:text> </xsl:text> + </span> +</xsl:template> + +<xsl:template match="classname" mode="idl"> + <xsl:if test="name(preceding-sibling::*[1]) = 'classname'"> + <xsl:text>, </xsl:text> + </xsl:if> + <span class="{name(.)}"> + <xsl:apply-templates mode="idl"/> + </span> +</xsl:template> + +<xsl:template match="interfacename" mode="idl"> + <xsl:if test="name(preceding-sibling::*[1]) = 'interfacename'"> + <xsl:text>, </xsl:text> + </xsl:if> + <span class="{name(.)}"> + <xsl:apply-templates mode="idl"/> + </span> +</xsl:template> + +<xsl:template match="exceptionname" mode="idl"> + <xsl:if test="name(preceding-sibling::*[1]) = 'exceptionname'"> + <xsl:text>, </xsl:text> + </xsl:if> + <span class="{name(.)}"> + <xsl:apply-templates mode="idl"/> + </span> +</xsl:template> + +<xsl:template match="fieldsynopsis" mode="idl"> + <div class="{name(.)}"> + <xsl:text> </xsl:text> + <xsl:apply-templates mode="idl"/> + <xsl:text>;</xsl:text> + </div> +</xsl:template> + +<xsl:template match="type" mode="idl"> + <span class="{name(.)}"> + <xsl:apply-templates mode="idl"/> + <xsl:text> </xsl:text> + </span> +</xsl:template> + +<xsl:template match="varname" mode="idl"> + <span class="{name(.)}"> + <xsl:apply-templates mode="idl"/> + <xsl:text> </xsl:text> + </span> +</xsl:template> + +<xsl:template match="initializer" mode="idl"> + <span class="{name(.)}"> + <xsl:text>= </xsl:text> + <xsl:apply-templates mode="idl"/> + </span> +</xsl:template> + +<xsl:template match="void" mode="idl"> + <span class="{name(.)}"> + <xsl:text>void </xsl:text> + </span> +</xsl:template> + +<xsl:template match="methodname" mode="idl"> + <span class="{name(.)}"> + <xsl:apply-templates mode="idl"/> + </span> +</xsl:template> + +<xsl:template match="methodparam" mode="idl"> + <xsl:if test="position() > 1"> + <xsl:text>, </xsl:text> + </xsl:if> + <span class="{name(.)}"> + <xsl:apply-templates mode="idl"/> + </span> +</xsl:template> + +<xsl:template match="parameter" mode="idl"> + <span class="{name(.)}"> + <xsl:apply-templates mode="idl"/> + </span> +</xsl:template> + +<xsl:template mode="idl" + match="constructorsynopsis|destructorsynopsis|methodsynopsis"> + <xsl:variable name="modifiers" select="modifier"/> + <xsl:variable name="notmod" select="*[name(.) != 'modifier']"/> + <xsl:variable name="type"> + </xsl:variable> + <div class="{name(.)}"> + <xsl:text> </xsl:text> + <xsl:apply-templates select="$modifiers" mode="idl"/> + + <!-- type --> + <xsl:if test="name($notmod[1]) != 'methodname'"> + <xsl:apply-templates select="$notmod[1]" mode="idl"/> + </xsl:if> + + <xsl:apply-templates select="methodname" mode="idl"/> + <xsl:text>(</xsl:text> + <xsl:apply-templates select="methodparam" mode="idl"/> + <xsl:text>)</xsl:text> + <xsl:if test="exceptionname"> + <xsl:text>&RE; raises(</xsl:text> + <xsl:apply-templates select="exceptionname" mode="idl"/> + <xsl:text>)</xsl:text> + </xsl:if> + <xsl:text>;</xsl:text> + </div> +</xsl:template> + +<!-- ===== Perl ======================================================== --> + +<xsl:template match="classsynopsis" mode="perl"> + <pre class="{name(.)}"> + <xsl:text>package </xsl:text> + <xsl:apply-templates select="ooclass[1]" mode="perl"/> + <xsl:text>;&RE;</xsl:text> + + <xsl:if test="ooclass[position() > 1]"> + <xsl:text>@ISA = (</xsl:text> + <xsl:apply-templates select="ooclass[position() > 1]" mode="perl"/> + <xsl:text>);&RE;</xsl:text> + </xsl:if> + + <xsl:apply-templates select="constructorsynopsis + |destructorsynopsis + |fieldsynopsis + |methodsynopsis + |classsynopsisinfo" mode="perl"/> + </pre> +</xsl:template> + +<xsl:template match="classsynopsisinfo" mode="perl"> + <xsl:apply-templates mode="perl"/> +</xsl:template> + +<xsl:template match="ooclass|oointerface|ooexception" mode="perl"> + <xsl:if test="position() > 1"> + <xsl:text>, </xsl:text> + </xsl:if> + <span class="{name(.)}"> + <xsl:apply-templates mode="perl"/> + </span> +</xsl:template> + +<xsl:template match="modifier" mode="perl"> + <span class="{name(.)}"> + <xsl:apply-templates mode="perl"/> + <xsl:text> </xsl:text> + </span> +</xsl:template> + +<xsl:template match="classname" mode="perl"> + <xsl:if test="name(preceding-sibling::*[1]) = 'classname'"> + <xsl:text>, </xsl:text> + </xsl:if> + <span class="{name(.)}"> + <xsl:apply-templates mode="perl"/> + </span> +</xsl:template> + +<xsl:template match="interfacename" mode="perl"> + <xsl:if test="name(preceding-sibling::*[1]) = 'interfacename'"> + <xsl:text>, </xsl:text> + </xsl:if> + <span class="{name(.)}"> + <xsl:apply-templates mode="perl"/> + </span> +</xsl:template> + +<xsl:template match="exceptionname" mode="perl"> + <xsl:if test="name(preceding-sibling::*[1]) = 'exceptionname'"> + <xsl:text>, </xsl:text> + </xsl:if> + <span class="{name(.)}"> + <xsl:apply-templates mode="perl"/> + </span> +</xsl:template> + +<xsl:template match="fieldsynopsis" mode="perl"> + <div class="{name(.)}"> + <xsl:text> </xsl:text> + <xsl:apply-templates mode="perl"/> + <xsl:text>;</xsl:text> + </div> +</xsl:template> + +<xsl:template match="type" mode="perl"> + <span class="{name(.)}"> + <xsl:apply-templates mode="perl"/> + <xsl:text> </xsl:text> + </span> +</xsl:template> + +<xsl:template match="varname" mode="perl"> + <span class="{name(.)}"> + <xsl:apply-templates mode="perl"/> + <xsl:text> </xsl:text> + </span> +</xsl:template> + +<xsl:template match="initializer" mode="perl"> + <span class="{name(.)}"> + <xsl:text>= </xsl:text> + <xsl:apply-templates mode="perl"/> + </span> +</xsl:template> + +<xsl:template match="void" mode="perl"> + <span class="{name(.)}"> + <xsl:text>void </xsl:text> + </span> +</xsl:template> + +<xsl:template match="methodname" mode="perl"> + <span class="{name(.)}"> + <xsl:apply-templates mode="perl"/> + </span> +</xsl:template> + +<xsl:template match="methodparam" mode="perl"> + <xsl:if test="position() > 1"> + <xsl:text>, </xsl:text> + </xsl:if> + <span class="{name(.)}"> + <xsl:apply-templates mode="perl"/> + </span> +</xsl:template> + +<xsl:template match="parameter" mode="perl"> + <span class="{name(.)}"> + <xsl:apply-templates mode="perl"/> + </span> +</xsl:template> + +<xsl:template mode="perl" + match="constructorsynopsis|destructorsynopsis|methodsynopsis"> + <xsl:variable name="modifiers" select="modifier"/> + <xsl:variable name="notmod" select="*[name(.) != 'modifier']"/> + <xsl:variable name="type"> + </xsl:variable> + <div class="{name(.)}"> + <xsl:text>sub </xsl:text> + + <xsl:apply-templates select="methodname" mode="perl"/> + <xsl:text> { ... };</xsl:text> + </div> +</xsl:template> + +<!-- ==================================================================== --> + +</xsl:stylesheet> diff --git a/tests/docbook/html/table.xsl b/tests/docbook/html/table.xsl new file mode 100644 index 00000000..72452956 --- /dev/null +++ b/tests/docbook/html/table.xsl @@ -0,0 +1,625 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" + xmlns:tbl="http://nwalsh.com/com.nwalsh.saxon6.Table" + exclude-result-prefixes="doc tbl" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<xsl:template match="tgroup"> + <table> + <xsl:choose> + <!-- If there's a <?dbhtml table-summary="foo"?> PI, use it for + the HTML table summary attribute --> + <xsl:when test="processing-instruction('dbhtml')"> + <xsl:variable name="summary"> + <xsl:call-template name="dbhtml-attribute"> + <xsl:with-param name="pis" + select="processing-instruction('dbhtml')[1]"/> + <xsl:with-param name="attribute" select="'table-summary'"/> + </xsl:call-template> + </xsl:variable> + <xsl:if test="$summary != ''"> + <xsl:attribute name="summary"> + <xsl:value-of select="$summary"/> + </xsl:attribute> + </xsl:if> + </xsl:when> + <!-- Otherwise, if there's a title, use that --> + <xsl:when test="../title"> + <xsl:attribute name="summary"> + <xsl:value-of select="string(../title)"/> + </xsl:attribute> + </xsl:when> + <!-- Otherwise, forget the whole idea --> + <xsl:otherwise><!-- nevermind --></xsl:otherwise> + </xsl:choose> + + <xsl:if test="../@pgwide=1"> + <xsl:attribute name="width">100%</xsl:attribute> + </xsl:if> + + <xsl:if test="@align"> + <xsl:attribute name="align"> + <xsl:value-of select="@align"/> + </xsl:attribute> + </xsl:if> + + <xsl:choose> + <xsl:when test="../@frame='none'"> + <xsl:attribute name="border">0</xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:attribute name="border">1</xsl:attribute> + </xsl:otherwise> + </xsl:choose> + + <xsl:variable name="vendor" select="system-property('xsl:vendor')"/> + + <xsl:variable name="colgroup"> + <colgroup> + <xsl:call-template name="generate.colgroup"> + <xsl:with-param name="cols" select="@cols"/> + </xsl:call-template> + </colgroup> + </xsl:variable> + + <xsl:variable name="explicit.table.width"> + <xsl:call-template name="dbhtml-attribute"> + <xsl:with-param name="pis" + select="../processing-instruction('dbhtml')[1]"/> + <xsl:with-param name="attribute" select="'table-width'"/> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="table.width"> + <xsl:choose> + <xsl:when test="$explicit.table.width != ''"> + <xsl:value-of select="$explicit.table.width"/> + </xsl:when> + <xsl:when test="$default.table.width = ''"> + <xsl:text>100%</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$default.table.width"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:if test="$default.table.width != '' + or $explicit.table.width != ''"> + <xsl:attribute name="width"> + <xsl:choose> + <xsl:when test="contains($table.width, '%')"> + <xsl:value-of select="$table.width"/> + </xsl:when> + <xsl:when test="contains($vendor, 'SAXON 6') + and $saxon.extensions != 0 + and $saxon.tablecolumns != 0"> + <xsl:value-of select="tbl:convertLength($table.width)"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$table.width"/> + </xsl:otherwise> + </xsl:choose> + </xsl:attribute> + </xsl:if> + + <xsl:choose> + <xsl:when test="contains($vendor, 'SAXON 6') + and $saxon.extensions != 0 + and $saxon.tablecolumns != 0"> + <xsl:copy-of select="tbl:adjustColumnWidths($colgroup)"/> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="$colgroup"/> + </xsl:otherwise> + </xsl:choose> + + <xsl:apply-templates/> + + <xsl:if test=".//footnote"> + <tr> + <td colspan="{@cols}"> + <xsl:apply-templates select=".//footnote" + mode="table.footnote.mode"/> + </td> + </tr> + </xsl:if> + </table> +</xsl:template> + +<xsl:template match="tgroup/processing-instruction('dbhtml')"> + <xsl:variable name="summary"> + <xsl:call-template name="dbhtml-attribute"> + <xsl:with-param name="pis" select="."/> + <xsl:with-param name="attribute" select="'table-summary'"/> + </xsl:call-template> + </xsl:variable> + + <!-- Suppress the table-summary PI --> + <xsl:if test="$summary = ''"> + <xsl:processing-instruction name="dbhtml"> + <xsl:value-of select="."/> + </xsl:processing-instruction> + </xsl:if> +</xsl:template> + +<xsl:template match="colspec"></xsl:template> + +<xsl:template match="spanspec"></xsl:template> + +<xsl:template match="thead|tfoot"> + <xsl:element name="{name(.)}"> + <xsl:if test="@align"> + <xsl:attribute name="align"> + <xsl:value-of select="@align"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="@char"> + <xsl:attribute name="char"> + <xsl:value-of select="@char"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="@charoff"> + <xsl:attribute name="charoff"> + <xsl:value-of select="@charoff"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="@valign"> + <xsl:attribute name="valign"> + <xsl:value-of select="@valign"/> + </xsl:attribute> + </xsl:if> + + <xsl:apply-templates/> + </xsl:element> +</xsl:template> + +<xsl:template match="tbody"> + <tbody> + <xsl:if test="@align"> + <xsl:attribute name="align"> + <xsl:value-of select="@align"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="@char"> + <xsl:attribute name="char"> + <xsl:value-of select="@char"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="@charoff"> + <xsl:attribute name="charoff"> + <xsl:value-of select="@charoff"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="@valign"> + <xsl:attribute name="valign"> + <xsl:value-of select="@valign"/> + </xsl:attribute> + </xsl:if> + + <xsl:apply-templates/> + </tbody> +</xsl:template> + +<xsl:template match="row"> + <tr> + <xsl:if test="@align"> + <xsl:attribute name="align"> + <xsl:value-of select="@align"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="@char"> + <xsl:attribute name="char"> + <xsl:value-of select="@char"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="@charoff"> + <xsl:attribute name="charoff"> + <xsl:value-of select="@charoff"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="@valign"> + <xsl:attribute name="valign"> + <xsl:value-of select="@valign"/> + </xsl:attribute> + </xsl:if> + + <xsl:apply-templates/> + </tr> +</xsl:template> + +<xsl:template match="thead/row/entry"> + <xsl:call-template name="process.cell"> + <xsl:with-param name="cellgi">th</xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="tbody/row/entry"> + <xsl:call-template name="process.cell"> + <xsl:with-param name="cellgi">td</xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template match="tfoot/row/entry"> + <xsl:call-template name="process.cell"> + <xsl:with-param name="cellgi">th</xsl:with-param> + </xsl:call-template> +</xsl:template> + +<xsl:template name="process.cell"> + <xsl:param name="cellgi">td</xsl:param> + <xsl:variable name="empty.cell" select="count(node()) = 0"/> + + <xsl:variable name="entry.colnum"> + <xsl:call-template name="entry.colnum"/> + </xsl:variable> + + <xsl:if test="$entry.colnum != ''"> + <xsl:variable name="prev.entry" select="preceding-sibling::*[1]"/> + <xsl:variable name="prev.ending.colnum"> + <xsl:choose> + <xsl:when test="$prev.entry"> + <xsl:call-template name="entry.ending.colnum"> + <xsl:with-param name="entry" select="$prev.entry"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise>0</xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:call-template name="add-empty-entries"> + <xsl:with-param name="number"> + <xsl:choose> + <xsl:when test="$prev.ending.colnum = ''">0</xsl:when> + <xsl:otherwise> + <xsl:value-of select="$entry.colnum - $prev.ending.colnum - 1"/> + </xsl:otherwise> + </xsl:choose> + </xsl:with-param> + </xsl:call-template> + </xsl:if> + + <xsl:element name="{$cellgi}"> + <xsl:if test="@morerows"> + <xsl:attribute name="rowspan"> + <xsl:value-of select="@morerows+1"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="@namest"> + <xsl:attribute name="colspan"> + <xsl:call-template name="calculate.colspan"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="@align"> + <xsl:attribute name="align"> + <xsl:value-of select="@align"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="@char"> + <xsl:attribute name="char"> + <xsl:value-of select="@char"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="@charoff"> + <xsl:attribute name="charoff"> + <xsl:value-of select="@charoff"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="@valign"> + <xsl:attribute name="valign"> + <xsl:value-of select="@valign"/> + </xsl:attribute> + </xsl:if> + + <xsl:if test="not(preceding-sibling::*) + and ancestor::row/@id"> + <a name="{ancestor::row/@id}"/> + </xsl:if> + + <xsl:if test="@id"> + <a name="{@id}"/> + </xsl:if> + + <xsl:choose> + <xsl:when test="$empty.cell"> + <xsl:text> </xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> + </xsl:element> +</xsl:template> + +<xsl:template name="add-empty-entries"> + <xsl:param name="number" select="'0'"/> + <xsl:choose> + <xsl:when test="$number <= 0"></xsl:when> + <xsl:otherwise> + <td> </td> + <xsl:call-template name="add-empty-entries"> + <xsl:with-param name="number" select="$number - 1"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<doc:template name="add-empty-entries" xmlns=""> +<refpurpose>Insert empty TDs into a table row</refpurpose> +<refdescription> +<para>This template inserts empty TDs into a table row.</para> +</refdescription> +<refparameter> +<variablelist> +<varlistentry><term>number</term> +<listitem> +<para>The number of empty TDs to add.</para> +</listitem> +</varlistentry> +</variablelist> +</refparameter> +<refreturn> +<para>Nothing</para> +</refreturn> +</doc:template> + +<xsl:template name="entry.colnum"> + <xsl:param name="entry" select="."/> + + <xsl:choose> + <xsl:when test="$entry/@colname"> + <xsl:variable name="colname" select="$entry/@colname"/> + <xsl:variable name="colspec" + select="$entry/ancestor::tgroup/colspec[@colname=$colname]"/> + <xsl:call-template name="colspec.colnum"> + <xsl:with-param name="colspec" select="$colspec"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$entry/@namest"> + <xsl:variable name="namest" select="$entry/@namest"/> + <xsl:variable name="colspec" + select="$entry/ancestor::tgroup/colspec[@colname=$namest]"/> + <xsl:call-template name="colspec.colnum"> + <xsl:with-param name="colspec" select="$colspec"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="count($entry/preceding-sibling::*) = 0">1</xsl:when> + <xsl:otherwise> + <xsl:variable name="pcol"> + <xsl:call-template name="entry.ending.colnum"> + <xsl:with-param name="entry" + select="$entry/preceding-sibling::*[1]"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="$pcol + 1"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<doc:template name="entry.colnum" xmlns=""> +<refpurpose>Determine the column number in which a given entry occurs</refpurpose> +<refdescription> +<para>If an <sgmltag>entry</sgmltag> has a +<sgmltag class="attribute">colname</sgmltag> or +<sgmltag class="attribute">namest</sgmltag> attribute, this template +will determine the number of the column in which the entry should occur. +For other <sgmltag>entry</sgmltag>s, nothing is returned.</para> +</refdescription> +<refparameter> +<variablelist> +<varlistentry><term>entry</term> +<listitem> +<para>The <sgmltag>entry</sgmltag>-element which is to be tested.</para> +</listitem> +</varlistentry> +</variablelist> +</refparameter> + +<refreturn> +<para>This template returns the column number if it can be determined, +or nothing (the empty string)</para> +</refreturn> +</doc:template> + +<xsl:template name="entry.ending.colnum"> + <xsl:param name="entry" select="."/> + + <xsl:choose> + <xsl:when test="$entry/@colname"> + <xsl:variable name="colname" select="$entry/@colname"/> + <xsl:variable name="colspec" + select="$entry/ancestor::tgroup/colspec[@colname=$colname]"/> + <xsl:call-template name="colspec.colnum"> + <xsl:with-param name="colspec" select="$colspec"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$entry/@nameend"> + <xsl:variable name="nameend" select="$entry/@nameend"/> + <xsl:variable name="colspec" + select="$entry/ancestor::tgroup/colspec[@colname=$nameend]"/> + <xsl:call-template name="colspec.colnum"> + <xsl:with-param name="colspec" select="$colspec"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="count($entry/preceding-sibling::*) = 0">1</xsl:when> + <xsl:otherwise> + <xsl:variable name="pcol"> + <xsl:call-template name="entry.ending.colnum"> + <xsl:with-param name="entry" + select="$entry/preceding-sibling::*[1]"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="$pcol + 1"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + + +<xsl:template name="colspec.colnum"> + <xsl:param name="colspec" select="."/> + <xsl:choose> + <xsl:when test="$colspec/@colnum"> + <xsl:value-of select="$colspec/@colnum"/> + </xsl:when> + <xsl:when test="$colspec/preceding-sibling::colspec"> + <xsl:variable name="prec.colspec.colnum"> + <xsl:call-template name="colspec.colnum"> + <xsl:with-param name="colspec" + select="$colspec/preceding-sibling::colspec[1]"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="$prec.colspec.colnum + 1"/> + </xsl:when> + <xsl:otherwise>1</xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="generate.colgroup"> + <xsl:param name="cols" select="1"/> + <xsl:param name="count" select="1"/> + <xsl:choose> + <xsl:when test="$count>$cols"></xsl:when> + <xsl:otherwise> + <xsl:call-template name="generate.col"> + <xsl:with-param name="countcol" select="$count"/> + </xsl:call-template> + <xsl:call-template name="generate.colgroup"> + <xsl:with-param name="cols" select="$cols"/> + <xsl:with-param name="count" select="$count+1"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="generate.col"> + <xsl:param name="countcol">1</xsl:param> + <xsl:param name="colspecs" select="./colspec"/> + <xsl:param name="count">1</xsl:param> + <xsl:param name="colnum">1</xsl:param> + + <xsl:choose> + <xsl:when test="$count>count($colspecs)"> + <col/> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="colspec" select="$colspecs[$count=position()]"/> + <xsl:variable name="colspec.colnum"> + <xsl:choose> + <xsl:when test="$colspec/@colnum"> + <xsl:value-of select="$colspec/@colnum"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$colnum"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:choose> + <xsl:when test="$colspec.colnum=$countcol"> + <col> + <xsl:if test="$colspec/@colwidth + and $saxon.extensions != 0 + and $saxon.tablecolumns != 0"> + <xsl:attribute name="width"> + <xsl:value-of select="$colspec/@colwidth"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="$colspec/@align"> + <xsl:attribute name="align"> + <xsl:value-of select="$colspec/@align"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="$colspec/@char"> + <xsl:attribute name="char"> + <xsl:value-of select="$colspec/@char"/> + </xsl:attribute> + </xsl:if> + <xsl:if test="$colspec/@charoff"> + <xsl:attribute name="charoff"> + <xsl:value-of select="$colspec/@charoff"/> + </xsl:attribute> + </xsl:if> + </col> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="generate.col"> + <xsl:with-param name="countcol" select="$countcol"/> + <xsl:with-param name="colspecs" select="$colspecs"/> + <xsl:with-param name="count" select="$count+1"/> + <xsl:with-param name="colnum"> + <xsl:choose> + <xsl:when test="$colspec/@colnum"> + <xsl:value-of select="$colspec/@colnum + 1"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$colnum + 1"/> + </xsl:otherwise> + </xsl:choose> + </xsl:with-param> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> + +</xsl:template> + +<xsl:template name="colspec.colwidth"> + <!-- when this macro is called, the current context must be an entry --> + <xsl:param name="colname"></xsl:param> + <!-- .. = row, ../.. = thead|tbody, ../../.. = tgroup --> + <xsl:param name="colspecs" select="../../../../tgroup/colspec"/> + <xsl:param name="count">1</xsl:param> + <xsl:choose> + <xsl:when test="$count>count($colspecs)"></xsl:when> + <xsl:otherwise> + <xsl:variable name="colspec" select="$colspecs[$count=position()]"/> + <xsl:choose> + <xsl:when test="$colspec/@colname=$colname"> + <xsl:value-of select="$colspec/@colwidth"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="colspec.colwidth"> + <xsl:with-param name="colname" select="$colname"/> + <xsl:with-param name="colspecs" select="$colspecs"/> + <xsl:with-param name="count" select="$count+1"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="calculate.colspan"> + <xsl:param name="entry" select="."/> + <xsl:variable name="namest" select="$entry/@namest"/> + <xsl:variable name="nameend" select="$entry/@nameend"/> + + <xsl:variable name="scol"> + <xsl:call-template name="colspec.colnum"> + <xsl:with-param name="colspec" + select="$entry/ancestor::tgroup/colspec[@colname=$namest]"/> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="ecol"> + <xsl:call-template name="colspec.colnum"> + <xsl:with-param name="colspec" + select="$entry/ancestor::tgroup/colspec[@colname=$nameend]"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="$ecol - $scol + 1"/> +</xsl:template> + +</xsl:stylesheet> + diff --git a/tests/docbook/html/titlepage.templates.xml b/tests/docbook/html/titlepage.templates.xml new file mode 100644 index 00000000..918ebfba --- /dev/null +++ b/tests/docbook/html/titlepage.templates.xml @@ -0,0 +1,527 @@ +<t:templates xmlns:t="http://nwalsh.com/docbook/xsl/template/1.0" + xmlns:param="http://nwalsh.com/docbook/xsl/template/1.0/param" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + +<!-- ==================================================================== --> + +<t:titlepage element="article" wrapper="div" class="titlepage"> + <t:titlepage-content side="recto"> + <title predicate="[1]"/> + <subtitle predicate="[1]"/> + <corpauthor/> + <authorgroup/> + <author/> + <releaseinfo/> + <copyright/> + <legalnotice/> + <pubdate/> + <revision/> + <revhistory/> + <abstract/> + </t:titlepage-content> + + <t:titlepage-content side="verso"> + </t:titlepage-content> + + <t:titlepage-separator> + <hr/> + </t:titlepage-separator> + + <t:titlepage-before side="recto"> + </t:titlepage-before> + + <t:titlepage-before side="verso"> + </t:titlepage-before> +</t:titlepage> + +<!-- ==================================================================== --> + +<t:titlepage element="set" wrapper="div" class="titlepage"> + <t:titlepage-content side="recto"> + <title predicate="[1]"/> + <subtitle predicate="[1]"/> + <corpauthor/> + <authorgroup/> + <author/> + <releaseinfo/> + <copyright/> + <legalnotice/> + <pubdate/> + <revision/> + <revhistory/> + <abstract/> + </t:titlepage-content> + + <t:titlepage-content side="verso"> + </t:titlepage-content> + + <t:titlepage-separator> + <hr/> + </t:titlepage-separator> + + <t:titlepage-before side="recto"> + </t:titlepage-before> + + <t:titlepage-before side="verso"> + </t:titlepage-before> +</t:titlepage> + +<!-- ==================================================================== --> + +<t:titlepage element="book" wrapper="div" class="titlepage"> + <t:titlepage-content side="recto"> + <title predicate="[1]"/> + <subtitle predicate="[1]"/> + <corpauthor/> + <authorgroup/> + <author/> + <releaseinfo/> + <copyright/> + <legalnotice/> + <pubdate/> + <revision/> + <revhistory/> + <abstract/> + </t:titlepage-content> + + <t:titlepage-content side="verso"> + </t:titlepage-content> + + <t:titlepage-separator> + <hr/> + </t:titlepage-separator> + + <t:titlepage-before side="recto"> + </t:titlepage-before> + + <t:titlepage-before side="verso"> + </t:titlepage-before> +</t:titlepage> + +<!-- ==================================================================== --> + +<t:titlepage element="part" wrapper="div" class="titlepage"> + <t:titlepage-content side="recto"> + <title predicate="[1]"/> + <subtitle predicate="[1]"/> + <corpauthor/> + <authorgroup/> + <author/> + <releaseinfo/> + <copyright/> + <legalnotice/> + <pubdate/> + <revision/> + <revhistory/> + <abstract/> + </t:titlepage-content> + + <t:titlepage-content side="verso"> + </t:titlepage-content> + + <t:titlepage-separator> + </t:titlepage-separator> + + <t:titlepage-before side="recto"> + </t:titlepage-before> + + <t:titlepage-before side="verso"> + </t:titlepage-before> +</t:titlepage> + +<t:titlepage element="partintro" wrapper="div"> + <t:titlepage-content side="recto"> + <title predicate="[1]"/> + <subtitle predicate="[1]"/> + <corpauthor/> + <authorgroup/> + <author/> + <releaseinfo/> + <copyright/> + <legalnotice/> + <pubdate/> + <revision/> + <revhistory/> + <abstract/> + </t:titlepage-content> + + <t:titlepage-content side="verso"> + </t:titlepage-content> + + <t:titlepage-separator> + </t:titlepage-separator> + + <t:titlepage-before side="recto"> + </t:titlepage-before> + + <t:titlepage-before side="verso"> + </t:titlepage-before> +</t:titlepage> + +<!-- ==================================================================== --> + +<t:titlepage element="reference" wrapper="div" class="titlepage"> + <t:titlepage-content side="recto"> + <title predicate="[1]"/> + <subtitle predicate="[1]"/> + <corpauthor/> + <authorgroup/> + <author/> + <releaseinfo/> + <copyright/> + <legalnotice/> + <pubdate/> + <revision/> + <revhistory/> + <abstract/> + </t:titlepage-content> + + <t:titlepage-content side="verso"> + </t:titlepage-content> + + <t:titlepage-separator> + <hr/> + </t:titlepage-separator> + + <t:titlepage-before side="recto"> + </t:titlepage-before> + + <t:titlepage-before side="verso"> + </t:titlepage-before> +</t:titlepage> + +<!-- ==================================================================== --> + + <t:titlepage element="dedication" wrapper="div" class="titlepage"> + <t:titlepage-content side="recto"> + <title predicate="[1]" + force="1" + named-template="component.title" + param:node="ancestor-or-self::dedication[1]"/> + <subtitle predicate="[1]"/> + </t:titlepage-content> + + <t:titlepage-content side="verso"> + </t:titlepage-content> + + <t:titlepage-separator> + </t:titlepage-separator> + + <t:titlepage-before side="recto"> + </t:titlepage-before> + + <t:titlepage-before side="verso"> + </t:titlepage-before> +</t:titlepage> + +<!-- ==================================================================== --> + +<t:titlepage element="preface" wrapper="div" class="titlepage"> + <t:titlepage-content side="recto"> + <title predicate="[1]" + force="1" + named-template="component.title" + param:node="ancestor-or-self::preface[1]"/> + <subtitle predicate="[1]"/> + <corpauthor/> + <authorgroup/> + <author/> + <releaseinfo/> + <copyright/> + <legalnotice/> + <pubdate/> + <revision/> + <revhistory/> + <abstract/> + </t:titlepage-content> + + <t:titlepage-content side="verso"> + </t:titlepage-content> + + <t:titlepage-separator> + </t:titlepage-separator> + + <t:titlepage-before side="recto"> + </t:titlepage-before> + + <t:titlepage-before side="verso"> + </t:titlepage-before> +</t:titlepage> + +<!-- ==================================================================== --> + +<t:titlepage element="chapter" wrapper="div" class="titlepage"> + <t:titlepage-content side="recto"> + <title predicate="[1]"/> + <subtitle predicate="[1]"/> + <corpauthor/> + <authorgroup/> + <author/> + <releaseinfo/> + <copyright/> + <legalnotice/> + <pubdate/> + <revision/> + <revhistory/> + <abstract/> + </t:titlepage-content> + + <t:titlepage-content side="verso"> + </t:titlepage-content> + + <t:titlepage-separator> + </t:titlepage-separator> + + <t:titlepage-before side="recto"> + </t:titlepage-before> + + <t:titlepage-before side="verso"> + </t:titlepage-before> +</t:titlepage> + +<!-- ==================================================================== --> + +<t:titlepage element="appendix" wrapper="div" class="titlepage"> + <t:titlepage-content side="recto"> + <title predicate="[1]"/> + <subtitle predicate="[1]"/> + <corpauthor/> + <authorgroup/> + <author/> + <releaseinfo/> + <copyright/> + <legalnotice/> + <pubdate/> + <revision/> + <revhistory/> + <abstract/> + </t:titlepage-content> + + <t:titlepage-content side="verso"> + </t:titlepage-content> + + <t:titlepage-separator> + </t:titlepage-separator> + + <t:titlepage-before side="recto"> + </t:titlepage-before> + + <t:titlepage-before side="verso"> + </t:titlepage-before> +</t:titlepage> + +<!-- ==================================================================== --> + +<t:titlepage element="section" wrapper="div" class="titlepage"> + <t:titlepage-content side="recto"> + <title predicate="[1]"/> + <subtitle predicate="[1]"/> + <corpauthor/> + <authorgroup/> + <author/> + <releaseinfo/> + <copyright/> + <legalnotice/> + <pubdate/> + <revision/> + <revhistory/> + <abstract/> + </t:titlepage-content> + + <t:titlepage-content side="verso"> + </t:titlepage-content> + + <t:titlepage-separator> + <xsl:if test="count(parent::*)='0'"><hr/></xsl:if> + </t:titlepage-separator> + + <t:titlepage-before side="recto"> + </t:titlepage-before> + + <t:titlepage-before side="verso"> + </t:titlepage-before> +</t:titlepage> + +<t:titlepage element="sect1" wrapper="div" class="titlepage"> + <t:titlepage-content side="recto"> + <title predicate="[1]"/> + <subtitle predicate="[1]"/> + <corpauthor/> + <authorgroup/> + <author/> + <releaseinfo/> + <copyright/> + <legalnotice/> + <pubdate/> + <revision/> + <revhistory/> + <abstract/> + </t:titlepage-content> + + <t:titlepage-content side="verso"> + </t:titlepage-content> + + <t:titlepage-separator> + <xsl:if test="count(parent::*)='0'"><hr/></xsl:if> + </t:titlepage-separator> + + <t:titlepage-before side="recto"> + </t:titlepage-before> + + <t:titlepage-before side="verso"> + </t:titlepage-before> +</t:titlepage> + +<t:titlepage element="sect2" wrapper="div" class="titlepage"> + <t:titlepage-content side="recto"> + <title predicate="[1]"/> + <subtitle predicate="[1]"/> + <corpauthor/> + <authorgroup/> + <author/> + <releaseinfo/> + <copyright/> + <legalnotice/> + <pubdate/> + <revision/> + <revhistory/> + <abstract/> + </t:titlepage-content> + + <t:titlepage-content side="verso"> + </t:titlepage-content> + + <t:titlepage-separator> + <xsl:if test="count(parent::*)='0'"><hr/></xsl:if> + </t:titlepage-separator> + + <t:titlepage-before side="recto"> + </t:titlepage-before> + + <t:titlepage-before side="verso"> + </t:titlepage-before> +</t:titlepage> + +<t:titlepage element="sect3" wrapper="div" class="titlepage"> + <t:titlepage-content side="recto"> + <title predicate="[1]"/> + <subtitle predicate="[1]"/> + <corpauthor/> + <authorgroup/> + <author/> + <releaseinfo/> + <copyright/> + <legalnotice/> + <pubdate/> + <revision/> + <revhistory/> + <abstract/> + </t:titlepage-content> + + <t:titlepage-content side="verso"> + </t:titlepage-content> + + <t:titlepage-separator> + <xsl:if test="count(parent::*)='0'"><hr/></xsl:if> + </t:titlepage-separator> + + <t:titlepage-before side="recto"> + </t:titlepage-before> + + <t:titlepage-before side="verso"> + </t:titlepage-before> +</t:titlepage> + +<t:titlepage element="sect4" wrapper="div" class="titlepage"> + <t:titlepage-content side="recto"> + <title predicate="[1]"/> + <subtitle predicate="[1]"/> + <corpauthor/> + <authorgroup/> + <author/> + <releaseinfo/> + <copyright/> + <legalnotice/> + <pubdate/> + <revision/> + <revhistory/> + <abstract/> + </t:titlepage-content> + + <t:titlepage-content side="verso"> + </t:titlepage-content> + + <t:titlepage-separator> + <xsl:if test="count(parent::*)='0'"><hr/></xsl:if> + </t:titlepage-separator> + + <t:titlepage-before side="recto"> + </t:titlepage-before> + + <t:titlepage-before side="verso"> + </t:titlepage-before> +</t:titlepage> + +<t:titlepage element="sect5" wrapper="div" class="titlepage"> + <t:titlepage-content side="recto"> + <title predicate="[1]"/> + <subtitle predicate="[1]"/> + <corpauthor/> + <authorgroup/> + <author/> + <releaseinfo/> + <copyright/> + <legalnotice/> + <pubdate/> + <revision/> + <revhistory/> + <abstract/> + </t:titlepage-content> + + <t:titlepage-content side="verso"> + </t:titlepage-content> + + <t:titlepage-separator> + <xsl:if test="count(parent::*)='0'"><hr/></xsl:if> + </t:titlepage-separator> + + <t:titlepage-before side="recto"> + </t:titlepage-before> + + <t:titlepage-before side="verso"> + </t:titlepage-before> +</t:titlepage> + +<t:titlepage element="simplesect" wrapper="div" class="titlepage"> + <t:titlepage-content side="recto"> + <title predicate="[1]"/> + <subtitle predicate="[1]"/> + <corpauthor/> + <authorgroup/> + <author/> + <releaseinfo/> + <copyright/> + <legalnotice/> + <pubdate/> + <revision/> + <revhistory/> + <abstract/> + </t:titlepage-content> + + <t:titlepage-content side="verso"> + </t:titlepage-content> + + <t:titlepage-separator> + <xsl:if test="count(parent::*)='0'"><hr/></xsl:if> + </t:titlepage-separator> + + <t:titlepage-before side="recto"> + </t:titlepage-before> + + <t:titlepage-before side="verso"> + </t:titlepage-before> +</t:titlepage> + +<!-- ==================================================================== --> + +</t:templates> diff --git a/tests/docbook/html/titlepage.templates.xsl b/tests/docbook/html/titlepage.templates.xsl new file mode 100644 index 00000000..e6f6ca8f --- /dev/null +++ b/tests/docbook/html/titlepage.templates.xsl @@ -0,0 +1,1986 @@ +<?xml version="1.0" encoding="utf-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + +<!-- This stylesheet was created by template/titlepage.xsl; do not edit it by hand. --> + +<xsl:template name="article.titlepage.recto"> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="(articleinfo/title|artheader/title|title)[1]"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="(articleinfo/subtitle|artheader/subtitle|subtitle)[1]"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/corpauthor|artheader/corpauthor"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/authorgroup|artheader/authorgroup"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/author|artheader/author"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/releaseinfo|artheader/releaseinfo"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/copyright|artheader/copyright"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/legalnotice|artheader/legalnotice"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/pubdate|artheader/pubdate"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/revision|artheader/revision"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/revhistory|artheader/revhistory"/> + <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/abstract|artheader/abstract"/> +</xsl:template> + +<xsl:template name="article.titlepage.verso"> +</xsl:template> + +<xsl:template name="article.titlepage.separator"><hr/> +</xsl:template> + +<xsl:template name="article.titlepage.before.recto"> +</xsl:template> + +<xsl:template name="article.titlepage.before.verso"> +</xsl:template> + +<xsl:template name="article.titlepage"> + <div class="titlepage"> + <xsl:call-template name="article.titlepage.before.recto"/> + <xsl:call-template name="article.titlepage.recto"/> + <xsl:call-template name="article.titlepage.before.verso"/> + <xsl:call-template name="article.titlepage.verso"/> + <xsl:call-template name="article.titlepage.separator"/> + </div> +</xsl:template> + +<xsl:template match="*" mode="article.titlepage.recto.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="*" mode="article.titlepage.verso.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="title" mode="article.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="article.titlepage.recto.style"> +<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="subtitle" mode="article.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="article.titlepage.recto.style"> +<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="corpauthor" mode="article.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="article.titlepage.recto.style"> +<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="authorgroup" mode="article.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="article.titlepage.recto.style"> +<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="author" mode="article.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="article.titlepage.recto.style"> +<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="releaseinfo" mode="article.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="article.titlepage.recto.style"> +<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="copyright" mode="article.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="article.titlepage.recto.style"> +<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="legalnotice" mode="article.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="article.titlepage.recto.style"> +<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="pubdate" mode="article.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="article.titlepage.recto.style"> +<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revision" mode="article.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="article.titlepage.recto.style"> +<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revhistory" mode="article.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="article.titlepage.recto.style"> +<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="abstract" mode="article.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="article.titlepage.recto.style"> +<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template name="set.titlepage.recto"> + <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="(setinfo/title|title)[1]"/> + <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="(setinfo/subtitle|subtitle)[1]"/> + <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/corpauthor"/> + <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/authorgroup"/> + <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/author"/> + <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/releaseinfo"/> + <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/copyright"/> + <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/legalnotice"/> + <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/pubdate"/> + <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/revision"/> + <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/revhistory"/> + <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/abstract"/> +</xsl:template> + +<xsl:template name="set.titlepage.verso"> +</xsl:template> + +<xsl:template name="set.titlepage.separator"><hr/> +</xsl:template> + +<xsl:template name="set.titlepage.before.recto"> +</xsl:template> + +<xsl:template name="set.titlepage.before.verso"> +</xsl:template> + +<xsl:template name="set.titlepage"> + <div class="titlepage"> + <xsl:call-template name="set.titlepage.before.recto"/> + <xsl:call-template name="set.titlepage.recto"/> + <xsl:call-template name="set.titlepage.before.verso"/> + <xsl:call-template name="set.titlepage.verso"/> + <xsl:call-template name="set.titlepage.separator"/> + </div> +</xsl:template> + +<xsl:template match="*" mode="set.titlepage.recto.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="*" mode="set.titlepage.verso.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="title" mode="set.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="set.titlepage.recto.style"> +<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="subtitle" mode="set.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="set.titlepage.recto.style"> +<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="corpauthor" mode="set.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="set.titlepage.recto.style"> +<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="authorgroup" mode="set.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="set.titlepage.recto.style"> +<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="author" mode="set.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="set.titlepage.recto.style"> +<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="releaseinfo" mode="set.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="set.titlepage.recto.style"> +<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="copyright" mode="set.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="set.titlepage.recto.style"> +<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="legalnotice" mode="set.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="set.titlepage.recto.style"> +<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="pubdate" mode="set.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="set.titlepage.recto.style"> +<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revision" mode="set.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="set.titlepage.recto.style"> +<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revhistory" mode="set.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="set.titlepage.recto.style"> +<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="abstract" mode="set.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="set.titlepage.recto.style"> +<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template name="book.titlepage.recto"> + <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="(bookinfo/title|title)[1]"/> + <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="(bookinfo/subtitle|subtitle)[1]"/> + <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/corpauthor"/> + <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/authorgroup"/> + <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/author"/> + <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/releaseinfo"/> + <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/copyright"/> + <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/legalnotice"/> + <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/pubdate"/> + <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/revision"/> + <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/revhistory"/> + <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/abstract"/> +</xsl:template> + +<xsl:template name="book.titlepage.verso"> +</xsl:template> + +<xsl:template name="book.titlepage.separator"><hr/> +</xsl:template> + +<xsl:template name="book.titlepage.before.recto"> +</xsl:template> + +<xsl:template name="book.titlepage.before.verso"> +</xsl:template> + +<xsl:template name="book.titlepage"> + <div class="titlepage"> + <xsl:call-template name="book.titlepage.before.recto"/> + <xsl:call-template name="book.titlepage.recto"/> + <xsl:call-template name="book.titlepage.before.verso"/> + <xsl:call-template name="book.titlepage.verso"/> + <xsl:call-template name="book.titlepage.separator"/> + </div> +</xsl:template> + +<xsl:template match="*" mode="book.titlepage.recto.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="*" mode="book.titlepage.verso.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="title" mode="book.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="book.titlepage.recto.style"> +<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="subtitle" mode="book.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="book.titlepage.recto.style"> +<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="corpauthor" mode="book.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="book.titlepage.recto.style"> +<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="authorgroup" mode="book.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="book.titlepage.recto.style"> +<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="author" mode="book.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="book.titlepage.recto.style"> +<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="releaseinfo" mode="book.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="book.titlepage.recto.style"> +<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="copyright" mode="book.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="book.titlepage.recto.style"> +<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="legalnotice" mode="book.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="book.titlepage.recto.style"> +<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="pubdate" mode="book.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="book.titlepage.recto.style"> +<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revision" mode="book.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="book.titlepage.recto.style"> +<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revhistory" mode="book.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="book.titlepage.recto.style"> +<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="abstract" mode="book.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="book.titlepage.recto.style"> +<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template name="part.titlepage.recto"> + <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="(partinfo/title|docinfo/title|title)[1]"/> + <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="(partinfo/subtitle|docinfo/subtitle|subtitle)[1]"/> + <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/corpauthor|docinfo/corpauthor"/> + <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/authorgroup|docinfo/authorgroup"/> + <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/author|docinfo/author"/> + <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/releaseinfo|docinfo/releaseinfo"/> + <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/copyright|docinfo/copyright"/> + <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/legalnotice|docinfo/legalnotice"/> + <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/pubdate|docinfo/pubdate"/> + <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/revision|docinfo/revision"/> + <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/revhistory|docinfo/revhistory"/> + <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/abstract|docinfo/abstract"/> +</xsl:template> + +<xsl:template name="part.titlepage.verso"> +</xsl:template> + +<xsl:template name="part.titlepage.separator"> +</xsl:template> + +<xsl:template name="part.titlepage.before.recto"> +</xsl:template> + +<xsl:template name="part.titlepage.before.verso"> +</xsl:template> + +<xsl:template name="part.titlepage"> + <div class="titlepage"> + <xsl:call-template name="part.titlepage.before.recto"/> + <xsl:call-template name="part.titlepage.recto"/> + <xsl:call-template name="part.titlepage.before.verso"/> + <xsl:call-template name="part.titlepage.verso"/> + <xsl:call-template name="part.titlepage.separator"/> + </div> +</xsl:template> + +<xsl:template match="*" mode="part.titlepage.recto.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="*" mode="part.titlepage.verso.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="title" mode="part.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="part.titlepage.recto.style"> +<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="subtitle" mode="part.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="part.titlepage.recto.style"> +<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="corpauthor" mode="part.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="part.titlepage.recto.style"> +<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="authorgroup" mode="part.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="part.titlepage.recto.style"> +<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="author" mode="part.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="part.titlepage.recto.style"> +<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="releaseinfo" mode="part.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="part.titlepage.recto.style"> +<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="copyright" mode="part.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="part.titlepage.recto.style"> +<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="legalnotice" mode="part.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="part.titlepage.recto.style"> +<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="pubdate" mode="part.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="part.titlepage.recto.style"> +<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revision" mode="part.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="part.titlepage.recto.style"> +<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revhistory" mode="part.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="part.titlepage.recto.style"> +<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="abstract" mode="part.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="part.titlepage.recto.style"> +<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template name="partintro.titlepage.recto"> + <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="(partintroinfo/title|docinfo/title|title)[1]"/> + <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="(partintroinfo/subtitle|docinfo/subtitle|subtitle)[1]"/> + <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/corpauthor|docinfo/corpauthor"/> + <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/authorgroup|docinfo/authorgroup"/> + <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/author|docinfo/author"/> + <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/releaseinfo|docinfo/releaseinfo"/> + <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/copyright|docinfo/copyright"/> + <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/legalnotice|docinfo/legalnotice"/> + <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/pubdate|docinfo/pubdate"/> + <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/revision|docinfo/revision"/> + <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/revhistory|docinfo/revhistory"/> + <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/abstract|docinfo/abstract"/> +</xsl:template> + +<xsl:template name="partintro.titlepage.verso"> +</xsl:template> + +<xsl:template name="partintro.titlepage.separator"> +</xsl:template> + +<xsl:template name="partintro.titlepage.before.recto"> +</xsl:template> + +<xsl:template name="partintro.titlepage.before.verso"> +</xsl:template> + +<xsl:template name="partintro.titlepage"> + <div> + <xsl:call-template name="partintro.titlepage.before.recto"/> + <xsl:call-template name="partintro.titlepage.recto"/> + <xsl:call-template name="partintro.titlepage.before.verso"/> + <xsl:call-template name="partintro.titlepage.verso"/> + <xsl:call-template name="partintro.titlepage.separator"/> + </div> +</xsl:template> + +<xsl:template match="*" mode="partintro.titlepage.recto.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="*" mode="partintro.titlepage.verso.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="title" mode="partintro.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="partintro.titlepage.recto.style"> +<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="subtitle" mode="partintro.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="partintro.titlepage.recto.style"> +<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="corpauthor" mode="partintro.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="partintro.titlepage.recto.style"> +<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="authorgroup" mode="partintro.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="partintro.titlepage.recto.style"> +<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="author" mode="partintro.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="partintro.titlepage.recto.style"> +<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="releaseinfo" mode="partintro.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="partintro.titlepage.recto.style"> +<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="copyright" mode="partintro.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="partintro.titlepage.recto.style"> +<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="legalnotice" mode="partintro.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="partintro.titlepage.recto.style"> +<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="pubdate" mode="partintro.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="partintro.titlepage.recto.style"> +<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revision" mode="partintro.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="partintro.titlepage.recto.style"> +<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revhistory" mode="partintro.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="partintro.titlepage.recto.style"> +<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="abstract" mode="partintro.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="partintro.titlepage.recto.style"> +<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template name="reference.titlepage.recto"> + <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="(referenceinfo/title|docinfo/title|title)[1]"/> + <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="(referenceinfo/subtitle|docinfo/subtitle|subtitle)[1]"/> + <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/corpauthor|docinfo/corpauthor"/> + <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/authorgroup|docinfo/authorgroup"/> + <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/author|docinfo/author"/> + <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/releaseinfo|docinfo/releaseinfo"/> + <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/copyright|docinfo/copyright"/> + <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/legalnotice|docinfo/legalnotice"/> + <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/pubdate|docinfo/pubdate"/> + <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/revision|docinfo/revision"/> + <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/revhistory|docinfo/revhistory"/> + <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/abstract|docinfo/abstract"/> +</xsl:template> + +<xsl:template name="reference.titlepage.verso"> +</xsl:template> + +<xsl:template name="reference.titlepage.separator"><hr/> +</xsl:template> + +<xsl:template name="reference.titlepage.before.recto"> +</xsl:template> + +<xsl:template name="reference.titlepage.before.verso"> +</xsl:template> + +<xsl:template name="reference.titlepage"> + <div class="titlepage"> + <xsl:call-template name="reference.titlepage.before.recto"/> + <xsl:call-template name="reference.titlepage.recto"/> + <xsl:call-template name="reference.titlepage.before.verso"/> + <xsl:call-template name="reference.titlepage.verso"/> + <xsl:call-template name="reference.titlepage.separator"/> + </div> +</xsl:template> + +<xsl:template match="*" mode="reference.titlepage.recto.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="*" mode="reference.titlepage.verso.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="title" mode="reference.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="reference.titlepage.recto.style"> +<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="subtitle" mode="reference.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="reference.titlepage.recto.style"> +<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="corpauthor" mode="reference.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="reference.titlepage.recto.style"> +<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="authorgroup" mode="reference.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="reference.titlepage.recto.style"> +<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="author" mode="reference.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="reference.titlepage.recto.style"> +<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="releaseinfo" mode="reference.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="reference.titlepage.recto.style"> +<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="copyright" mode="reference.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="reference.titlepage.recto.style"> +<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="legalnotice" mode="reference.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="reference.titlepage.recto.style"> +<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="pubdate" mode="reference.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="reference.titlepage.recto.style"> +<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revision" mode="reference.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="reference.titlepage.recto.style"> +<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revhistory" mode="reference.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="reference.titlepage.recto.style"> +<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="abstract" mode="reference.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="reference.titlepage.recto.style"> +<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template name="dedication.titlepage.recto"> + <div xsl:use-attribute-sets="dedication.titlepage.recto.style"> +<xsl:call-template name="component.title"> +<xsl:with-param name="node" select="ancestor-or-self::dedication[1]"/> +</xsl:call-template></div> + <xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="(dedicationinfo/subtitle|docinfo/subtitle|subtitle)[1]"/> +</xsl:template> + +<xsl:template name="dedication.titlepage.verso"> +</xsl:template> + +<xsl:template name="dedication.titlepage.separator"> +</xsl:template> + +<xsl:template name="dedication.titlepage.before.recto"> +</xsl:template> + +<xsl:template name="dedication.titlepage.before.verso"> +</xsl:template> + +<xsl:template name="dedication.titlepage"> + <div class="titlepage"> + <xsl:call-template name="dedication.titlepage.before.recto"/> + <xsl:call-template name="dedication.titlepage.recto"/> + <xsl:call-template name="dedication.titlepage.before.verso"/> + <xsl:call-template name="dedication.titlepage.verso"/> + <xsl:call-template name="dedication.titlepage.separator"/> + </div> +</xsl:template> + +<xsl:template match="*" mode="dedication.titlepage.recto.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="*" mode="dedication.titlepage.verso.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="subtitle" mode="dedication.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="dedication.titlepage.recto.style"> +<xsl:apply-templates select="." mode="dedication.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template name="preface.titlepage.recto"> + <div xsl:use-attribute-sets="preface.titlepage.recto.style"> +<xsl:call-template name="component.title"> +<xsl:with-param name="node" select="ancestor-or-self::preface[1]"/> +</xsl:call-template></div> + <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="(prefaceinfo/subtitle|docinfo/subtitle|subtitle)[1]"/> + <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/corpauthor|docinfo/corpauthor"/> + <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/authorgroup|docinfo/authorgroup"/> + <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/author|docinfo/author"/> + <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/releaseinfo|docinfo/releaseinfo"/> + <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/copyright|docinfo/copyright"/> + <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/legalnotice|docinfo/legalnotice"/> + <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/pubdate|docinfo/pubdate"/> + <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/revision|docinfo/revision"/> + <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/revhistory|docinfo/revhistory"/> + <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/abstract|docinfo/abstract"/> +</xsl:template> + +<xsl:template name="preface.titlepage.verso"> +</xsl:template> + +<xsl:template name="preface.titlepage.separator"> +</xsl:template> + +<xsl:template name="preface.titlepage.before.recto"> +</xsl:template> + +<xsl:template name="preface.titlepage.before.verso"> +</xsl:template> + +<xsl:template name="preface.titlepage"> + <div class="titlepage"> + <xsl:call-template name="preface.titlepage.before.recto"/> + <xsl:call-template name="preface.titlepage.recto"/> + <xsl:call-template name="preface.titlepage.before.verso"/> + <xsl:call-template name="preface.titlepage.verso"/> + <xsl:call-template name="preface.titlepage.separator"/> + </div> +</xsl:template> + +<xsl:template match="*" mode="preface.titlepage.recto.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="*" mode="preface.titlepage.verso.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="subtitle" mode="preface.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="preface.titlepage.recto.style"> +<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="corpauthor" mode="preface.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="preface.titlepage.recto.style"> +<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="authorgroup" mode="preface.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="preface.titlepage.recto.style"> +<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="author" mode="preface.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="preface.titlepage.recto.style"> +<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="releaseinfo" mode="preface.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="preface.titlepage.recto.style"> +<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="copyright" mode="preface.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="preface.titlepage.recto.style"> +<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="legalnotice" mode="preface.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="preface.titlepage.recto.style"> +<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="pubdate" mode="preface.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="preface.titlepage.recto.style"> +<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revision" mode="preface.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="preface.titlepage.recto.style"> +<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revhistory" mode="preface.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="preface.titlepage.recto.style"> +<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="abstract" mode="preface.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="preface.titlepage.recto.style"> +<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template name="chapter.titlepage.recto"> + <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="(chapterinfo/title|docinfo/title|title)[1]"/> + <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="(chapterinfo/subtitle|docinfo/subtitle|subtitle)[1]"/> + <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/corpauthor|docinfo/corpauthor"/> + <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/authorgroup|docinfo/authorgroup"/> + <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/author|docinfo/author"/> + <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/releaseinfo|docinfo/releaseinfo"/> + <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/copyright|docinfo/copyright"/> + <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/legalnotice|docinfo/legalnotice"/> + <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/pubdate|docinfo/pubdate"/> + <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/revision|docinfo/revision"/> + <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/revhistory|docinfo/revhistory"/> + <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/abstract|docinfo/abstract"/> +</xsl:template> + +<xsl:template name="chapter.titlepage.verso"> +</xsl:template> + +<xsl:template name="chapter.titlepage.separator"> +</xsl:template> + +<xsl:template name="chapter.titlepage.before.recto"> +</xsl:template> + +<xsl:template name="chapter.titlepage.before.verso"> +</xsl:template> + +<xsl:template name="chapter.titlepage"> + <div class="titlepage"> + <xsl:call-template name="chapter.titlepage.before.recto"/> + <xsl:call-template name="chapter.titlepage.recto"/> + <xsl:call-template name="chapter.titlepage.before.verso"/> + <xsl:call-template name="chapter.titlepage.verso"/> + <xsl:call-template name="chapter.titlepage.separator"/> + </div> +</xsl:template> + +<xsl:template match="*" mode="chapter.titlepage.recto.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="*" mode="chapter.titlepage.verso.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="title" mode="chapter.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="chapter.titlepage.recto.style"> +<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="subtitle" mode="chapter.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="chapter.titlepage.recto.style"> +<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="corpauthor" mode="chapter.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="chapter.titlepage.recto.style"> +<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="authorgroup" mode="chapter.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="chapter.titlepage.recto.style"> +<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="author" mode="chapter.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="chapter.titlepage.recto.style"> +<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="releaseinfo" mode="chapter.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="chapter.titlepage.recto.style"> +<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="copyright" mode="chapter.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="chapter.titlepage.recto.style"> +<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="legalnotice" mode="chapter.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="chapter.titlepage.recto.style"> +<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="pubdate" mode="chapter.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="chapter.titlepage.recto.style"> +<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revision" mode="chapter.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="chapter.titlepage.recto.style"> +<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revhistory" mode="chapter.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="chapter.titlepage.recto.style"> +<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="abstract" mode="chapter.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="chapter.titlepage.recto.style"> +<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template name="appendix.titlepage.recto"> + <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="(appendixinfo/title|docinfo/title|title)[1]"/> + <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="(appendixinfo/subtitle|docinfo/subtitle|subtitle)[1]"/> + <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/corpauthor|docinfo/corpauthor"/> + <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/authorgroup|docinfo/authorgroup"/> + <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/author|docinfo/author"/> + <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/releaseinfo|docinfo/releaseinfo"/> + <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/copyright|docinfo/copyright"/> + <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/legalnotice|docinfo/legalnotice"/> + <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/pubdate|docinfo/pubdate"/> + <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/revision|docinfo/revision"/> + <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/revhistory|docinfo/revhistory"/> + <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/abstract|docinfo/abstract"/> +</xsl:template> + +<xsl:template name="appendix.titlepage.verso"> +</xsl:template> + +<xsl:template name="appendix.titlepage.separator"> +</xsl:template> + +<xsl:template name="appendix.titlepage.before.recto"> +</xsl:template> + +<xsl:template name="appendix.titlepage.before.verso"> +</xsl:template> + +<xsl:template name="appendix.titlepage"> + <div class="titlepage"> + <xsl:call-template name="appendix.titlepage.before.recto"/> + <xsl:call-template name="appendix.titlepage.recto"/> + <xsl:call-template name="appendix.titlepage.before.verso"/> + <xsl:call-template name="appendix.titlepage.verso"/> + <xsl:call-template name="appendix.titlepage.separator"/> + </div> +</xsl:template> + +<xsl:template match="*" mode="appendix.titlepage.recto.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="*" mode="appendix.titlepage.verso.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="title" mode="appendix.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="appendix.titlepage.recto.style"> +<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="subtitle" mode="appendix.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="appendix.titlepage.recto.style"> +<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="corpauthor" mode="appendix.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="appendix.titlepage.recto.style"> +<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="authorgroup" mode="appendix.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="appendix.titlepage.recto.style"> +<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="author" mode="appendix.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="appendix.titlepage.recto.style"> +<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="releaseinfo" mode="appendix.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="appendix.titlepage.recto.style"> +<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="copyright" mode="appendix.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="appendix.titlepage.recto.style"> +<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="legalnotice" mode="appendix.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="appendix.titlepage.recto.style"> +<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="pubdate" mode="appendix.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="appendix.titlepage.recto.style"> +<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revision" mode="appendix.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="appendix.titlepage.recto.style"> +<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revhistory" mode="appendix.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="appendix.titlepage.recto.style"> +<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="abstract" mode="appendix.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="appendix.titlepage.recto.style"> +<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template name="section.titlepage.recto"> + <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="(sectioninfo/title|title)[1]"/> + <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="(sectioninfo/subtitle|subtitle)[1]"/> + <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/corpauthor"/> + <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/authorgroup"/> + <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/author"/> + <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/releaseinfo"/> + <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/copyright"/> + <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/legalnotice"/> + <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/pubdate"/> + <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/revision"/> + <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/revhistory"/> + <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/abstract"/> +</xsl:template> + +<xsl:template name="section.titlepage.verso"> +</xsl:template> + +<xsl:template name="section.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> +</xsl:template> + +<xsl:template name="section.titlepage.before.recto"> +</xsl:template> + +<xsl:template name="section.titlepage.before.verso"> +</xsl:template> + +<xsl:template name="section.titlepage"> + <div class="titlepage"> + <xsl:call-template name="section.titlepage.before.recto"/> + <xsl:call-template name="section.titlepage.recto"/> + <xsl:call-template name="section.titlepage.before.verso"/> + <xsl:call-template name="section.titlepage.verso"/> + <xsl:call-template name="section.titlepage.separator"/> + </div> +</xsl:template> + +<xsl:template match="*" mode="section.titlepage.recto.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="*" mode="section.titlepage.verso.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="title" mode="section.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="section.titlepage.recto.style"> +<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="subtitle" mode="section.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="section.titlepage.recto.style"> +<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="corpauthor" mode="section.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="section.titlepage.recto.style"> +<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="authorgroup" mode="section.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="section.titlepage.recto.style"> +<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="author" mode="section.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="section.titlepage.recto.style"> +<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="releaseinfo" mode="section.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="section.titlepage.recto.style"> +<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="copyright" mode="section.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="section.titlepage.recto.style"> +<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="legalnotice" mode="section.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="section.titlepage.recto.style"> +<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="pubdate" mode="section.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="section.titlepage.recto.style"> +<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revision" mode="section.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="section.titlepage.recto.style"> +<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revhistory" mode="section.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="section.titlepage.recto.style"> +<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="abstract" mode="section.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="section.titlepage.recto.style"> +<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template name="sect1.titlepage.recto"> + <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="(sect1info/title|title)[1]"/> + <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="(sect1info/subtitle|subtitle)[1]"/> + <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/corpauthor"/> + <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/authorgroup"/> + <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/author"/> + <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/releaseinfo"/> + <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/copyright"/> + <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/legalnotice"/> + <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/pubdate"/> + <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/revision"/> + <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/revhistory"/> + <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/abstract"/> +</xsl:template> + +<xsl:template name="sect1.titlepage.verso"> +</xsl:template> + +<xsl:template name="sect1.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> +</xsl:template> + +<xsl:template name="sect1.titlepage.before.recto"> +</xsl:template> + +<xsl:template name="sect1.titlepage.before.verso"> +</xsl:template> + +<xsl:template name="sect1.titlepage"> + <div class="titlepage"> + <xsl:call-template name="sect1.titlepage.before.recto"/> + <xsl:call-template name="sect1.titlepage.recto"/> + <xsl:call-template name="sect1.titlepage.before.verso"/> + <xsl:call-template name="sect1.titlepage.verso"/> + <xsl:call-template name="sect1.titlepage.separator"/> + </div> +</xsl:template> + +<xsl:template match="*" mode="sect1.titlepage.recto.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="*" mode="sect1.titlepage.verso.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="title" mode="sect1.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect1.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="subtitle" mode="sect1.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect1.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="corpauthor" mode="sect1.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect1.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="authorgroup" mode="sect1.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect1.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="author" mode="sect1.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect1.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="releaseinfo" mode="sect1.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect1.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="copyright" mode="sect1.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect1.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="legalnotice" mode="sect1.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect1.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="pubdate" mode="sect1.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect1.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revision" mode="sect1.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect1.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revhistory" mode="sect1.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect1.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="abstract" mode="sect1.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect1.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template name="sect2.titlepage.recto"> + <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="(sect2info/title|title)[1]"/> + <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="(sect2info/subtitle|subtitle)[1]"/> + <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/corpauthor"/> + <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/authorgroup"/> + <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/author"/> + <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/releaseinfo"/> + <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/copyright"/> + <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/legalnotice"/> + <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/pubdate"/> + <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/revision"/> + <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/revhistory"/> + <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/abstract"/> +</xsl:template> + +<xsl:template name="sect2.titlepage.verso"> +</xsl:template> + +<xsl:template name="sect2.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> +</xsl:template> + +<xsl:template name="sect2.titlepage.before.recto"> +</xsl:template> + +<xsl:template name="sect2.titlepage.before.verso"> +</xsl:template> + +<xsl:template name="sect2.titlepage"> + <div class="titlepage"> + <xsl:call-template name="sect2.titlepage.before.recto"/> + <xsl:call-template name="sect2.titlepage.recto"/> + <xsl:call-template name="sect2.titlepage.before.verso"/> + <xsl:call-template name="sect2.titlepage.verso"/> + <xsl:call-template name="sect2.titlepage.separator"/> + </div> +</xsl:template> + +<xsl:template match="*" mode="sect2.titlepage.recto.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="*" mode="sect2.titlepage.verso.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="title" mode="sect2.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect2.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="subtitle" mode="sect2.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect2.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="corpauthor" mode="sect2.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect2.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="authorgroup" mode="sect2.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect2.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="author" mode="sect2.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect2.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="releaseinfo" mode="sect2.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect2.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="copyright" mode="sect2.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect2.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="legalnotice" mode="sect2.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect2.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="pubdate" mode="sect2.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect2.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revision" mode="sect2.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect2.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revhistory" mode="sect2.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect2.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="abstract" mode="sect2.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect2.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template name="sect3.titlepage.recto"> + <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="(sect3info/title|title)[1]"/> + <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="(sect3info/subtitle|subtitle)[1]"/> + <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/corpauthor"/> + <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/authorgroup"/> + <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/author"/> + <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/releaseinfo"/> + <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/copyright"/> + <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/legalnotice"/> + <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/pubdate"/> + <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/revision"/> + <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/revhistory"/> + <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/abstract"/> +</xsl:template> + +<xsl:template name="sect3.titlepage.verso"> +</xsl:template> + +<xsl:template name="sect3.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> +</xsl:template> + +<xsl:template name="sect3.titlepage.before.recto"> +</xsl:template> + +<xsl:template name="sect3.titlepage.before.verso"> +</xsl:template> + +<xsl:template name="sect3.titlepage"> + <div class="titlepage"> + <xsl:call-template name="sect3.titlepage.before.recto"/> + <xsl:call-template name="sect3.titlepage.recto"/> + <xsl:call-template name="sect3.titlepage.before.verso"/> + <xsl:call-template name="sect3.titlepage.verso"/> + <xsl:call-template name="sect3.titlepage.separator"/> + </div> +</xsl:template> + +<xsl:template match="*" mode="sect3.titlepage.recto.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="*" mode="sect3.titlepage.verso.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="title" mode="sect3.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect3.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="subtitle" mode="sect3.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect3.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="corpauthor" mode="sect3.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect3.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="authorgroup" mode="sect3.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect3.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="author" mode="sect3.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect3.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="releaseinfo" mode="sect3.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect3.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="copyright" mode="sect3.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect3.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="legalnotice" mode="sect3.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect3.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="pubdate" mode="sect3.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect3.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revision" mode="sect3.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect3.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revhistory" mode="sect3.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect3.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="abstract" mode="sect3.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect3.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template name="sect4.titlepage.recto"> + <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="(sect4info/title|title)[1]"/> + <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="(sect4info/subtitle|subtitle)[1]"/> + <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/corpauthor"/> + <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/authorgroup"/> + <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/author"/> + <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/releaseinfo"/> + <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/copyright"/> + <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/legalnotice"/> + <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/pubdate"/> + <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/revision"/> + <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/revhistory"/> + <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/abstract"/> +</xsl:template> + +<xsl:template name="sect4.titlepage.verso"> +</xsl:template> + +<xsl:template name="sect4.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> +</xsl:template> + +<xsl:template name="sect4.titlepage.before.recto"> +</xsl:template> + +<xsl:template name="sect4.titlepage.before.verso"> +</xsl:template> + +<xsl:template name="sect4.titlepage"> + <div class="titlepage"> + <xsl:call-template name="sect4.titlepage.before.recto"/> + <xsl:call-template name="sect4.titlepage.recto"/> + <xsl:call-template name="sect4.titlepage.before.verso"/> + <xsl:call-template name="sect4.titlepage.verso"/> + <xsl:call-template name="sect4.titlepage.separator"/> + </div> +</xsl:template> + +<xsl:template match="*" mode="sect4.titlepage.recto.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="*" mode="sect4.titlepage.verso.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="title" mode="sect4.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect4.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="subtitle" mode="sect4.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect4.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="corpauthor" mode="sect4.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect4.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="authorgroup" mode="sect4.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect4.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="author" mode="sect4.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect4.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="releaseinfo" mode="sect4.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect4.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="copyright" mode="sect4.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect4.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="legalnotice" mode="sect4.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect4.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="pubdate" mode="sect4.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect4.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revision" mode="sect4.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect4.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revhistory" mode="sect4.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect4.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="abstract" mode="sect4.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect4.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template name="sect5.titlepage.recto"> + <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="(sect5info/title|title)[1]"/> + <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="(sect5info/subtitle|subtitle)[1]"/> + <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/corpauthor"/> + <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/authorgroup"/> + <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/author"/> + <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/releaseinfo"/> + <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/copyright"/> + <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/legalnotice"/> + <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/pubdate"/> + <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/revision"/> + <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/revhistory"/> + <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/abstract"/> +</xsl:template> + +<xsl:template name="sect5.titlepage.verso"> +</xsl:template> + +<xsl:template name="sect5.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> +</xsl:template> + +<xsl:template name="sect5.titlepage.before.recto"> +</xsl:template> + +<xsl:template name="sect5.titlepage.before.verso"> +</xsl:template> + +<xsl:template name="sect5.titlepage"> + <div class="titlepage"> + <xsl:call-template name="sect5.titlepage.before.recto"/> + <xsl:call-template name="sect5.titlepage.recto"/> + <xsl:call-template name="sect5.titlepage.before.verso"/> + <xsl:call-template name="sect5.titlepage.verso"/> + <xsl:call-template name="sect5.titlepage.separator"/> + </div> +</xsl:template> + +<xsl:template match="*" mode="sect5.titlepage.recto.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="*" mode="sect5.titlepage.verso.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="title" mode="sect5.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect5.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="subtitle" mode="sect5.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect5.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="corpauthor" mode="sect5.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect5.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="authorgroup" mode="sect5.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect5.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="author" mode="sect5.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect5.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="releaseinfo" mode="sect5.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect5.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="copyright" mode="sect5.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect5.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="legalnotice" mode="sect5.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect5.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="pubdate" mode="sect5.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect5.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revision" mode="sect5.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect5.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revhistory" mode="sect5.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect5.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="abstract" mode="sect5.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="sect5.titlepage.recto.style"> +<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template name="simplesect.titlepage.recto"> + <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="(simplesectinfo/title|docinfo/title|title)[1]"/> + <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="(simplesectinfo/subtitle|docinfo/subtitle|subtitle)[1]"/> + <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/corpauthor|docinfo/corpauthor"/> + <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/authorgroup|docinfo/authorgroup"/> + <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/author|docinfo/author"/> + <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/releaseinfo|docinfo/releaseinfo"/> + <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/copyright|docinfo/copyright"/> + <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/legalnotice|docinfo/legalnotice"/> + <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/pubdate|docinfo/pubdate"/> + <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/revision|docinfo/revision"/> + <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/revhistory|docinfo/revhistory"/> + <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/abstract|docinfo/abstract"/> +</xsl:template> + +<xsl:template name="simplesect.titlepage.verso"> +</xsl:template> + +<xsl:template name="simplesect.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if> +</xsl:template> + +<xsl:template name="simplesect.titlepage.before.recto"> +</xsl:template> + +<xsl:template name="simplesect.titlepage.before.verso"> +</xsl:template> + +<xsl:template name="simplesect.titlepage"> + <div class="titlepage"> + <xsl:call-template name="simplesect.titlepage.before.recto"/> + <xsl:call-template name="simplesect.titlepage.recto"/> + <xsl:call-template name="simplesect.titlepage.before.verso"/> + <xsl:call-template name="simplesect.titlepage.verso"/> + <xsl:call-template name="simplesect.titlepage.separator"/> + </div> +</xsl:template> + +<xsl:template match="*" mode="simplesect.titlepage.recto.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="*" mode="simplesect.titlepage.verso.mode"> + <!-- if an element isn't found in this mode, --> + <!-- try the generic titlepage.mode --> + <xsl:apply-templates select="." mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="title" mode="simplesect.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> +<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="subtitle" mode="simplesect.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> +<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="corpauthor" mode="simplesect.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> +<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="authorgroup" mode="simplesect.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> +<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="author" mode="simplesect.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> +<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="releaseinfo" mode="simplesect.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> +<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="copyright" mode="simplesect.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> +<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="legalnotice" mode="simplesect.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> +<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="pubdate" mode="simplesect.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> +<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revision" mode="simplesect.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> +<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="revhistory" mode="simplesect.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> +<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> +</div> +</xsl:template> + +<xsl:template match="abstract" mode="simplesect.titlepage.recto.auto.mode"> +<div xsl:use-attribute-sets="simplesect.titlepage.recto.style"> +<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/> +</div> +</xsl:template> + +</xsl:stylesheet>
\ No newline at end of file diff --git a/tests/docbook/html/titlepage.xsl b/tests/docbook/html/titlepage.xsl new file mode 100644 index 00000000..f2da969d --- /dev/null +++ b/tests/docbook/html/titlepage.xsl @@ -0,0 +1,598 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<!-- ==================================================================== --> + +<xsl:attribute-set name="book.titlepage.recto.style"/> +<xsl:attribute-set name="book.titlepage.verso.style"/> + +<xsl:attribute-set name="article.titlepage.recto.style"/> +<xsl:attribute-set name="article.titlepage.verso.style"/> + +<xsl:attribute-set name="set.titlepage.recto.style"/> +<xsl:attribute-set name="set.titlepage.verso.style"/> + +<xsl:attribute-set name="part.titlepage.recto.style"/> +<xsl:attribute-set name="part.titlepage.verso.style"/> + +<xsl:attribute-set name="partintro.titlepage.recto.style"/> +<xsl:attribute-set name="partintro.titlepage.verso.style"/> + +<xsl:attribute-set name="reference.titlepage.recto.style"/> +<xsl:attribute-set name="reference.titlepage.verso.style"/> + +<xsl:attribute-set name="dedication.titlepage.recto.style"/> +<xsl:attribute-set name="dedication.titlepage.verso.style"/> + +<xsl:attribute-set name="preface.titlepage.recto.style"/> +<xsl:attribute-set name="preface.titlepage.verso.style"/> + +<xsl:attribute-set name="chapter.titlepage.recto.style"/> +<xsl:attribute-set name="chapter.titlepage.verso.style"/> + +<xsl:attribute-set name="appendix.titlepage.recto.style"/> +<xsl:attribute-set name="appendix.titlepage.verso.style"/> + +<xsl:attribute-set name="section.titlepage.recto.style"/> +<xsl:attribute-set name="section.titlepage.verso.style"/> + +<xsl:attribute-set name="sect1.titlepage.recto.style" + use-attribute-sets="section.titlepage.recto.style"/> +<xsl:attribute-set name="sect1.titlepage.verso.style" + use-attribute-sets="section.titlepage.verso.style"/> + +<xsl:attribute-set name="sect2.titlepage.recto.style" + use-attribute-sets="section.titlepage.recto.style"/> +<xsl:attribute-set name="sect2.titlepage.verso.style" + use-attribute-sets="section.titlepage.verso.style"/> + +<xsl:attribute-set name="sect3.titlepage.recto.style" + use-attribute-sets="section.titlepage.recto.style"/> +<xsl:attribute-set name="sect3.titlepage.verso.style" + use-attribute-sets="section.titlepage.verso.style"/> + +<xsl:attribute-set name="sect4.titlepage.recto.style" + use-attribute-sets="section.titlepage.recto.style"/> +<xsl:attribute-set name="sect4.titlepage.verso.style" + use-attribute-sets="section.titlepage.verso.style"/> + +<xsl:attribute-set name="sect5.titlepage.recto.style" + use-attribute-sets="section.titlepage.recto.style"/> +<xsl:attribute-set name="sect5.titlepage.verso.style" + use-attribute-sets="section.titlepage.verso.style"/> + +<xsl:attribute-set name="simplesect.titlepage.recto.style" + use-attribute-sets="section.titlepage.recto.style"/> +<xsl:attribute-set name="simplesect.titlepage.verso.style" + use-attribute-sets="section.titlepage.verso.style"/> + +<xsl:attribute-set name="table.of.contents.titlepage.recto.style"/> +<xsl:attribute-set name="table.of.contents.titlepage.verso.style"/> + +<xsl:attribute-set name="list.of.tables.titlepage.recto.style"/> +<xsl:attribute-set name="list.of.tables.contents.titlepage.verso.style"/> + +<xsl:attribute-set name="list.of.figures.titlepage.recto.style"/> +<xsl:attribute-set name="list.of.figures.contents.titlepage.verso.style"/> + +<xsl:attribute-set name="list.of.equations.titlepage.recto.style"/> +<xsl:attribute-set name="list.of.equations.contents.titlepage.verso.style"/> + +<xsl:attribute-set name="list.of.examples.titlepage.recto.style"/> +<xsl:attribute-set name="list.of.examples.contents.titlepage.verso.style"/> + +<xsl:attribute-set name="list.of.unknowns.titlepage.recto.style"/> +<xsl:attribute-set name="list.of.unknowns.contents.titlepage.verso.style"/> + +<!-- ==================================================================== --> + +<xsl:template match="*" mode="titlepage.mode"> + <!-- if an element isn't found in this mode, try the default mode --> + <xsl:apply-templates select="."/> +</xsl:template> + +<xsl:template match="abbrev" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="abstract" mode="titlepage.mode"> + <div class="{name(.)}"> + <xsl:call-template name="formal.object.heading"> + <xsl:with-param name="title"> + <xsl:apply-templates select="." mode="title.ref"/> + </xsl:with-param> + </xsl:call-template> + <xsl:apply-templates mode="titlepage.mode"/> + </div> +</xsl:template> + +<xsl:template match="abstract/title" mode="titlepage.mode"> +</xsl:template> + +<xsl:template match="address" mode="titlepage.mode"> +<!-- this won't do quite what's desired... --> + <pre class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + </pre> +</xsl:template> + +<xsl:template match="affiliation" mode="titlepage.mode"> + <div class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + </div> +</xsl:template> + +<xsl:template match="artpagenums" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="author" mode="titlepage.mode"> + <h3 class="{name(.)}"><xsl:call-template name="person.name"/></h3> + <xsl:apply-templates mode="titlepage.mode" select="./affiliation"/> +</xsl:template> + +<xsl:template match="authorblurb" mode="titlepage.mode"> + <div class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + </div> +</xsl:template> + +<xsl:template match="authorgroup" mode="titlepage.mode"> + <xsl:apply-templates mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="authorinitials" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="bibliomisc" mode="titlepage.mode"> + <xsl:apply-templates mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="bibliomset" mode="titlepage.mode"> + <xsl:apply-templates mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="collab" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="confgroup" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="contractnum" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="contractsponsor" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="contrib" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="copyright" mode="titlepage.mode"> + <xsl:variable name="years" select="year"/> + <xsl:variable name="holders" select="holder"/> + + <p class="{name(.)}"> + <xsl:call-template name="gentext.element.name"/> + <xsl:call-template name="gentext.space"/> + <xsl:call-template name="dingbat"> + <xsl:with-param name="dingbat">copyright</xsl:with-param> + </xsl:call-template> + <xsl:call-template name="gentext.space"/> + <xsl:apply-templates select="$years" mode="titlepage.mode"/> + <xsl:call-template name="gentext.space"/> + <xsl:call-template name="gentext.by"/> + <xsl:call-template name="gentext.space"/> + <xsl:apply-templates select="$holders" mode="titlepage.mode"/> + </p> +</xsl:template> + +<xsl:template match="year" mode="titlepage.mode"> + <xsl:apply-templates/><xsl:text>, </xsl:text> +</xsl:template> + +<xsl:template match="year[position()=last()]" mode="titlepage.mode"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="holder" mode="titlepage.mode"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="corpauthor" mode="titlepage.mode"> + <h3 class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + </h3> +</xsl:template> + +<xsl:template match="corpname" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="date" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="edition" mode="titlepage.mode"> + <p class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <xsl:text> </xsl:text> + <xsl:call-template name="gentext.element.name"/> + </p> +</xsl:template> + +<xsl:template match="editor" mode="titlepage.mode"> + <h3 class="{name(.)}"><xsl:call-template name="person.name"/></h3> +</xsl:template> + +<xsl:template match="editor[position()=1]" mode="titlepage.mode"> + <h4 class="editedby"><xsl:call-template name="gentext.edited.by"/></h4> + <h3 class="{name(.)}"><xsl:call-template name="person.name"/></h3> +</xsl:template> + +<xsl:template match="firstname" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="graphic" mode="titlepage.mode"> + <!-- use the normal graphic handling code --> + <xsl:apply-templates select="."/> +</xsl:template> + +<xsl:template match="honorific" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="isbn" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="issn" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="itermset" mode="titlepage.mode"> +</xsl:template> + +<xsl:template match="invpartnumber" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="issuenum" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="jobtitle" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="keywordset" mode="titlepage.mode"> +</xsl:template> + +<xsl:template match="legalnotice " mode="titlepage.mode"> + <div class="{local-name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + </div> +</xsl:template> + +<xsl:template match="legalnotice/title" mode="titlepage.mode"> + <p class="legalnotice-title"><b><xsl:apply-templates/></b></p> +</xsl:template> + +<xsl:template match="lineage" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="modespec" mode="titlepage.mode"> +</xsl:template> + +<xsl:template match="orgdiv" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="orgname" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="othercredit" mode="titlepage.mode"> + <h3 class="{name(.)}"><xsl:call-template name="person.name"/></h3> + <xsl:apply-templates mode="titlepage.mode" + select="./affiliation"/> +</xsl:template> + +<xsl:template match="othername" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="pagenums" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="printhistory" mode="titlepage.mode"> + <div class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + </div> +</xsl:template> + +<xsl:template match="productname" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="productnumber" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="pubdate" mode="titlepage.mode"> + <p class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + </p> +</xsl:template> + +<xsl:template match="publishername" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="pubsnumber" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="releaseinfo" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="revhistory" mode="titlepage.mode"> + <xsl:variable name="numcols"> + <xsl:choose> + <xsl:when test="//authorinitials">3</xsl:when> + <xsl:otherwise>2</xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <div class="{name(.)}"> + <table border="1" width="100%" summary="Revision history"> + <tr> + <th align="left" valign="top" colspan="{$numcols}"> + <b><xsl:call-template name="gentext.element.name"/></b> + </th> + </tr> + <xsl:apply-templates mode="titlepage.mode"> + <xsl:with-param name="numcols" select="$numcols"/> + </xsl:apply-templates> + </table> + </div> +</xsl:template> + +<xsl:template match="revhistory/revision" mode="titlepage.mode"> + <xsl:param name="numcols" select="'3'"/> + <xsl:variable name="revnumber" select=".//revnumber"/> + <xsl:variable name="revdate" select=".//date"/> + <xsl:variable name="revauthor" select=".//authorinitials"/> + <xsl:variable name="revremark" select=".//revremark|.//revdescription"/> + <tr> + <td align="left"> + <xsl:if test="$revnumber"> + <xsl:call-template name="gentext.element.name"/> + <xsl:text> </xsl:text> + <xsl:apply-templates select="$revnumber[1]" mode="titlepage.mode"/> + </xsl:if> + </td> + <td align="left"> + <xsl:apply-templates select="$revdate[1]" mode="titlepage.mode"/> + </td> + <xsl:choose> + <xsl:when test="$revauthor"> + <td align="left"> + <xsl:apply-templates select="$revauthor[1]" mode="titlepage.mode"/> + </td> + </xsl:when> + <xsl:when test="$numcols > 2"> + <td> </td> + </xsl:when> + <xsl:otherwise></xsl:otherwise> + </xsl:choose> + </tr> + <xsl:if test="$revremark"> + <tr> + <td align="left" colspan="{$numcols}"> + <xsl:apply-templates select="$revremark[1]" mode="titlepage.mode"/> + </td> + </tr> + </xsl:if> +</xsl:template> + +<xsl:template match="revision/revnumber" mode="titlepage.mode"> + <xsl:apply-templates mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="revision/date" mode="titlepage.mode"> + <xsl:apply-templates mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="revision/authorinitials" mode="titlepage.mode"> + <xsl:apply-templates mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="revision/revremark" mode="titlepage.mode"> + <xsl:apply-templates mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="revision/revdescription" mode="titlepage.mode"> + <xsl:apply-templates mode="titlepage.mode"/> +</xsl:template> + +<xsl:template match="seriesvolnums" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="shortaffil" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="subjectset" mode="titlepage.mode"> +</xsl:template> + +<xsl:template match="subtitle" mode="titlepage.mode"> + <h2 class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + </h2> +</xsl:template> + +<xsl:template match="surname" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="title" mode="titlepage.mode"> + <xsl:variable name="id"> + <xsl:choose> + <!-- if title is in an *info wrapper, get the grandparent --> + <xsl:when test="contains(local-name(..), 'info')"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select="../.."/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select=".."/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <h1 class="{name(.)}"> + <a name="{$id}"/> + <xsl:choose> + <xsl:when test="$show.revisionflag and @revisionflag"> + <span class="{@revisionflag}"> + <xsl:apply-templates mode="titlepage.mode"/> + </span> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates mode="titlepage.mode"/> + </xsl:otherwise> + </xsl:choose> + </h1> +</xsl:template> + +<xsl:template match="titleabbrev" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<xsl:template match="volumenum" mode="titlepage.mode"> + <span class="{name(.)}"> + <xsl:apply-templates mode="titlepage.mode"/> + <br/> + </span> +</xsl:template> + +<!-- ==================================================================== --> + +</xsl:stylesheet> diff --git a/tests/docbook/html/toc.xsl b/tests/docbook/html/toc.xsl new file mode 100644 index 00000000..55d47162 --- /dev/null +++ b/tests/docbook/html/toc.xsl @@ -0,0 +1,31 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<!-- ==================================================================== --> + +<xsl:template match="toc"> +</xsl:template> + +<xsl:template match="tocpart|tocchap|tocfront|tocback|tocentry"> +</xsl:template> + +<xsl:template match="toclevel1|toclevel2|toclevel3|toclevel4|toclevel5"> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="lot|lotentry"> +</xsl:template> + +</xsl:stylesheet> diff --git a/tests/docbook/html/verbatim.xsl b/tests/docbook/html/verbatim.xsl new file mode 100644 index 00000000..58a051cb --- /dev/null +++ b/tests/docbook/html/verbatim.xsl @@ -0,0 +1,280 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:verb5="http://nwalsh.com/com.nwalsh.saxon.Verbatim" + xmlns:verb6="http://nwalsh.com/com.nwalsh.saxon6.Verbatim" + exclude-result-prefixes="verb5 verb6" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<xsl:template match="programlisting|screen|synopsis"> + <xsl:param name="suppress-numbers" select="'0'"/> + <xsl:variable name="vendor" select="system-property('xsl:vendor')"/> + <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable> + + <!-- Obey the <?dbhtml linenumbering.everyNth="x"?> PI --> + <xsl:variable name="default.linenumbering.everyNth" + select="$linenumbering.everyNth"/> + + <xsl:variable name="pi.linenumbering.everyNth"> + <xsl:call-template name="dbhtml-attribute"> + <xsl:with-param name="attribute" select="'everyNth'"/> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="linenumbering.everyNth"> + <xsl:choose> + <xsl:when test="$pi.linenumbering.everyNth != ''"> + <xsl:value-of select="$pi.linenumbering.everyNth"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$default.linenumbering.everyNth"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <!-- Obey the <?dbhtml linenumbering.separator="x"?> PI --> + <xsl:variable name="default.linenumbering.separator" + select="$linenumbering.separator"/> + + <xsl:variable name="pi.linenumbering.separator"> + <xsl:call-template name="dbhtml-attribute"> + <xsl:with-param name="attribute" select="'linenumbering.separator'"/> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="linenumbering.separator"> + <xsl:choose> + <xsl:when test="$pi.linenumbering.separator != ''"> + <xsl:value-of select="$pi.linenumbering.separator"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$default.linenumbering.separator"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:if test="@id"> + <a href="{$id}"/> + </xsl:if> + + <xsl:choose> + <xsl:when test="$suppress-numbers = '0' + and @linenumbering = 'numbered' + and $saxon.extensions != '0' + and $saxon.linenumbering != '0'"> + <xsl:variable name="rtf"> + <xsl:apply-templates/> + </xsl:variable> + <pre class="{name(.)}"> + <xsl:choose> + <xsl:when test="contains($vendor, 'SAXON 6')"> + <xsl:copy-of select="verb6:numberLines($rtf)"/> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="verb5:numberLines($rtf, + $linenumbering.everyNth, + $linenumbering.width, + $linenumbering.separator)"/> + </xsl:otherwise> + </xsl:choose> + </pre> + </xsl:when> + <xsl:otherwise> + <pre class="{name(.)}"> + <xsl:apply-templates/> + </pre> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="literallayout"> + <xsl:param name="suppress-numbers" select="'0'"/> + <xsl:variable name="vendor" select="system-property('xsl:vendor')"/> + + <xsl:variable name="rtf"> + <xsl:apply-templates/> + </xsl:variable> + + <xsl:choose> + <xsl:when test="$suppress-numbers = '0' + and @linenumbering = 'numbered' + and $saxon.extensions != '0' + and $saxon.linenumbering != '0'"> + <xsl:choose> + <xsl:when test="@class='monospaced'"> + <pre class="{name(.)}"> + <xsl:choose> + <xsl:when test="contains($vendor, 'SAXON 6')"> + <xsl:copy-of select="verb6:numberLines($rtf)"/> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="verb5:numberLines($rtf, + $linenumbering.everyNth, + $linenumbering.width, + $linenumbering.separator)"/> + </xsl:otherwise> + </xsl:choose> + </pre> + </xsl:when> + <xsl:otherwise> + <div class="{name(.)}"> + <xsl:choose> + <xsl:when test="contains($vendor, 'SAXON 6')"> + <xsl:copy-of select="verb6:numberLines($rtf)"/> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="verb5:numberLines($rtf, + $linenumbering.everyNth, + $linenumbering.width, + $linenumbering.separator)"/> + </xsl:otherwise> + </xsl:choose> + </div> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:choose> + <xsl:when test="@class='monospaced'"> + <pre class="{name(.)}"> + <xsl:copy-of select="$rtf"/> + </pre> + </xsl:when> + <xsl:otherwise> + <div class="{name(.)}"> + <xsl:copy-of select="$rtf"/> + </div> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="literallayout[not(@class) + or @class != 'monospaced']//text()"> + <xsl:call-template name="make-verbatim"> + <xsl:with-param name="text" select="."/> + </xsl:call-template> +</xsl:template> + +<xsl:template match="address"> + <xsl:param name="suppress-numbers" select="'0'"/> + <xsl:variable name="vendor" select="system-property('xsl:vendor')"/> + + <xsl:variable name="rtf"> + <xsl:apply-templates/> + </xsl:variable> + + <xsl:choose> + <xsl:when test="$suppress-numbers = '0' + and @linenumbering = 'numbered' + and $saxon.extensions != '0' + and $saxon.linenumbering != '0'"> + <div class="{name(.)}"> + <xsl:choose> + <xsl:when test="contains($vendor, 'SAXON 6')"> + <xsl:copy-of select="verb6:numberLines($rtf)"/> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="verb5:numberLines($rtf, + $linenumbering.everyNth, + $linenumbering.width, + $linenumbering.separator)"/> + </xsl:otherwise> + </xsl:choose> + </div> + </xsl:when> + <xsl:otherwise> + <div class="{name(.)}"> + <xsl:apply-templates/> + </div> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="address//text()"> + <xsl:call-template name="make-verbatim"> + <xsl:with-param name="text" select="."/> + </xsl:call-template> +</xsl:template> + +<xsl:template name="make-verbatim"> + <xsl:param name="text" select="''"/> + + <xsl:variable name="starts-with-space" + select="substring($text, 1, 1) = ' '"/> + + <xsl:variable name="starts-with-nl" + select="substring($text, 1, 1) = '
'"/> + + <xsl:variable name="before-space"> + <xsl:if test="contains($text, ' ')"> + <xsl:value-of select="substring-before($text, ' ')"/> + </xsl:if> + </xsl:variable> + + <xsl:variable name="before-nl"> + <xsl:if test="contains($text, '
')"> + <xsl:value-of select="substring-before($text, '
')"/> + </xsl:if> + </xsl:variable> + + <xsl:choose> + <xsl:when test="$starts-with-space"> + <xsl:text> </xsl:text> + <xsl:call-template name="make-verbatim"> + <xsl:with-param name="text" select="substring($text,2)"/> + </xsl:call-template> + </xsl:when> + + <xsl:when test="$starts-with-nl"> + <br/><xsl:text>
</xsl:text> + <xsl:call-template name="make-verbatim"> + <xsl:with-param name="text" select="substring($text,2)"/> + </xsl:call-template> + </xsl:when> + + <!-- if the string before a space is shorter than the string before + a newline, fix the space...--> + <xsl:when test="$before-space != '' + and ((string-length($before-space) + < string-length($before-nl)) + or $before-nl = '')"> + <xsl:value-of select="$before-space"/> + <xsl:text> </xsl:text> + <xsl:call-template name="make-verbatim"> + <xsl:with-param name="text" select="substring-after($text, ' ')"/> + </xsl:call-template> + </xsl:when> + + <!-- if the string before a newline is shorter than the string before + a space, fix the newline...--> + <xsl:when test="$before-nl != '' + and ((string-length($before-nl) + < string-length($before-space)) + or $before-space = '')"> + <xsl:value-of select="$before-nl"/> + <br/><xsl:text>
</xsl:text> + <xsl:call-template name="make-verbatim"> + <xsl:with-param name="text" select="substring-after($text, '
')"/> + </xsl:call-template> + </xsl:when> + + <!-- the string before the newline and the string before the + space are the same; which means they must both be empty --> + <xsl:otherwise> + <xsl:value-of select="$text"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +</xsl:stylesheet> diff --git a/tests/docbook/html/xref.xsl b/tests/docbook/html/xref.xsl new file mode 100644 index 00000000..b0efbe6e --- /dev/null +++ b/tests/docbook/html/xref.xsl @@ -0,0 +1,633 @@ +<?xml version='1.0'?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" + exclude-result-prefixes="doc" + version='1.0'> + +<!-- ******************************************************************** + $Id$ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://nwalsh.com/docbook/xsl/ for copyright + and other information. + + ******************************************************************** --> + +<!-- ==================================================================== --> + +<xsl:template match="anchor"> + <a> + <xsl:attribute name="name"> + <xsl:call-template name="object.id"/> + </xsl:attribute> + </a> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="xref"> + <xsl:variable name="targets" select="id(@linkend)"/> + <xsl:variable name="target" select="$targets[1]"/> + <xsl:variable name="refelem" select="local-name($target)"/> + + <xsl:call-template name="check.id.unique"> + <xsl:with-param name="linkend" select="@linkend"/> + </xsl:call-template> + + <xsl:if test="@id"> + <a name="{@id}"/> + </xsl:if> + + <xsl:choose> + <xsl:when test="$refelem=''"> + <xsl:message> + <xsl:text>XRef to nonexistent id: </xsl:text> + <xsl:value-of select="@linkend"/> + </xsl:message> + <xsl:text>???</xsl:text> + </xsl:when> + + <xsl:when test="$target/@xreflabel"> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$target"/> + </xsl:call-template> + </xsl:attribute> + <xsl:call-template name="xref.xreflabel"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </a> + </xsl:when> + + <xsl:otherwise> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$target"/> + </xsl:call-template> + </xsl:attribute> + + <xsl:choose> + <xsl:when test="@endterm"> + <xsl:variable name="etargets" select="id(@endterm)"/> + <xsl:variable name="etarget" select="$etargets[1]"/> + <xsl:choose> + <xsl:when test="count($etarget) = 0"> + <xsl:message> + <xsl:value-of select="count($etargets)"/> + <xsl:text>Endterm points to nonexistent ID: </xsl:text> + <xsl:value-of select="@endterm"/> + </xsl:message> + <xsl:text>???</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="$etarget" mode="xref.text"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + + <xsl:otherwise> + <xsl:apply-templates select="$target" mode="xref-to"/> + </xsl:otherwise> +<!-- + <xsl:when test="$refelem='figure'"> + <xsl:call-template name="xref.figure"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </xsl:when> + + <xsl:when test="$refelem='example'"> + <xsl:call-template name="xref.example"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </xsl:when> + + <xsl:when test="$refelem='table'"> + <xsl:call-template name="xref.table"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </xsl:when> + + <xsl:when test="$refelem='equation'"> + <xsl:call-template name="xref.equation"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </xsl:when> + + <xsl:when test="$refelem='cmdsynopsis'"> + <xsl:call-template name="xref.cmdsynopsis"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </xsl:when> + + <xsl:when test="$refelem='funcsynopsis'"> + <xsl:call-template name="xref.funcsynopsis"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </xsl:when> + + <xsl:when test="$refelem='dedication'"> + <xsl:call-template name="xref.dedication"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </xsl:when> + + <xsl:when test="$refelem='preface'"> + <xsl:call-template name="xref.preface"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </xsl:when> + + <xsl:when test="$refelem='chapter'"> + <xsl:call-template name="xref.chapter"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </xsl:when> + + <xsl:when test="$refelem='appendix'"> + <xsl:call-template name="xref.appendix"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </xsl:when> + + <xsl:when test="$refelem='bibliography'"> + <xsl:call-template name="xref.bibliography"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </xsl:when> + + <xsl:when test="$refelem='biblioentry'"> + <xsl:call-template name="xref.biblioentry"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </xsl:when> + + <xsl:when test="$refelem='bibliomixed'"> + <xsl:call-template name="xref.biblioentry"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </xsl:when> + + <xsl:when test="$refelem='glossary'"> + <xsl:call-template name="xref.glossary"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </xsl:when> + + <xsl:when test="$refelem='index'"> + <xsl:call-template name="xref.index"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </xsl:when> + + <xsl:when test="$refelem='section' + or $refelem='simplesect' + or $refelem='sect1' + or $refelem='sect2' + or $refelem='sect3' + or $refelem='sect4' + or $refelem='sect5' + or $refelem='refsect1' + or $refelem='refsect2' + or $refelem='refsect3'"> + <xsl:call-template name="xref.section"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </xsl:when> + + <xsl:when test="$refelem='listitem' + and local-name($target/..)='orderedlist'"> + <xsl:apply-templates select="$target" mode="xref"/> + </xsl:when> + + <xsl:when test="$refelem='question'"> + <xsl:call-template name="xref.question"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </xsl:when> + + <xsl:when test="$refelem='answer'"> + <xsl:call-template name="xref.answer"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </xsl:when> + + <xsl:when test="$refelem='part'"> + <xsl:call-template name="xref.part"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </xsl:when> + + <xsl:when test="$refelem='reference'"> + <xsl:call-template name="xref.reference"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </xsl:when> + + <xsl:when test="$refelem='co'"> + <xsl:call-template name="xref.co"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </xsl:when> + + <xsl:when test="$refelem='book'"> + <xsl:call-template name="xref.book"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> + </xsl:when> + + <xsl:otherwise> + <xsl:message> + <xsl:text>[Don't know what gentext to create for xref to: "</xsl:text> + <xsl:value-of select="$refelem"/> + <xsl:text>"]</xsl:text> + </xsl:message> + <xsl:text>???</xsl:text> + </xsl:otherwise> +--> + </xsl:choose> + </a> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template name="cross-reference"> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + <xsl:param name="xref.text"> + <xsl:call-template name="gentext.xref.text"> + <xsl:with-param name="element.name" select="$refelem"/> + <xsl:with-param name="default">%g %n</xsl:with-param> + </xsl:call-template> + </xsl:param> + + <xsl:call-template name="subst.xref.text"> + <xsl:with-param name="xref.text" select="$xref.text"/> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> +</xsl:template> + +<xsl:template match="*" mode="xref-to"> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + + <xsl:message> + <xsl:text>[Don't know what gentext to create for xref to: "</xsl:text> + <xsl:value-of select="$refelem"/> + <xsl:text>"]</xsl:text> + </xsl:message> + <xsl:text>???</xsl:text> +</xsl:template> + +<xsl:template match="author" mode="xref-to"> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + + <xsl:call-template name="person.name"/> +</xsl:template> + +<xsl:template match="figure" mode="xref-to"> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + + <xsl:call-template name="cross-reference"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> +</xsl:template> + +<xsl:template match="example" mode="xref-to"> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + + <xsl:call-template name="cross-reference"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> +</xsl:template> + +<xsl:template match="table" mode="xref-to"> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + + <xsl:call-template name="cross-reference"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> +</xsl:template> + +<xsl:template match="equation" mode="xref-to"> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + + <xsl:call-template name="cross-reference"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> +</xsl:template> + +<xsl:template match="cmdsynopsis" mode="xref-to"> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + + <xsl:variable name="command" select="($target//command)[1]"/> + + <xsl:apply-templates select="$command" mode="xref"/> +</xsl:template> + +<xsl:template match="funcsynopsis" mode="xref-to"> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + + <xsl:variable name="func" select="($target//function)[1]"/> + + <xsl:apply-templates select="$func" mode="xref"/> +</xsl:template> + +<xsl:template match="dedication" mode="xref-to"> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + + <xsl:call-template name="cross-reference"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> +</xsl:template> + +<xsl:template match="preface" mode="xref-to"> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + + <xsl:call-template name="cross-reference"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> +</xsl:template> + +<xsl:template match="chapter" mode="xref-to"> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + + <xsl:call-template name="cross-reference"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> +</xsl:template> + +<xsl:template match="appendix" mode="xref-to"> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + + <xsl:call-template name="cross-reference"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> +</xsl:template> + +<xsl:template match="bibliography" mode="xref-to"> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + + <xsl:call-template name="cross-reference"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> +</xsl:template> + +<xsl:template match="biblioentry|bibliomixed" mode="xref-to"> + <!-- handles both biblioentry and bibliomixed --> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + + <xsl:text>[</xsl:text> + <xsl:choose> + <xsl:when test="local-name($target/*[1]) = 'abbrev'"> + <xsl:apply-templates select="$target/*[1]"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="@id"/> + </xsl:otherwise> + </xsl:choose> + <xsl:text>]</xsl:text> +</xsl:template> + +<xsl:template match="glossary" mode="xref-to"> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + + <xsl:call-template name="cross-reference"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> +</xsl:template> + +<xsl:template match="index" mode="xref-to"> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + + <xsl:call-template name="cross-reference"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> +</xsl:template> + +<xsl:template match="section|simplesect + |sect1|sect2|sect3|sect4|sect5 + |refsect1|refsect2|refsect3" mode="xref-to"> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + + <xsl:choose> + <xsl:when test="$section.autolabel"> + <xsl:call-template name="gentext.element.name"> + <xsl:with-param name="element.name" select="$refelem"/> + </xsl:call-template> + <xsl:text> </xsl:text> + <xsl:apply-templates select="$target" mode="label.content"/> + + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="gentext.element.name"> + <xsl:with-param name="element.name">the section called</xsl:with-param> + </xsl:call-template> + <xsl:text> </xsl:text> + <xsl:call-template name="gentext.startquote"/> + <xsl:apply-templates select="$target" mode="title.content"/> + <xsl:call-template name="gentext.endquote"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="question" mode="xref-to"> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + + <xsl:call-template name="cross-reference"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> +</xsl:template> + +<xsl:template match="answer" mode="xref-to"> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + + <xsl:call-template name="cross-reference"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> +</xsl:template> + +<xsl:template match="part" mode="xref-to"> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + + <xsl:call-template name="cross-reference"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> +</xsl:template> + +<xsl:template match="reference" mode="xref-to"> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + + <xsl:call-template name="cross-reference"> + <xsl:with-param name="target" select="$target"/> + </xsl:call-template> +</xsl:template> + +<xsl:template match="co" mode="xref-to"> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + <xsl:apply-templates select="$target" mode="callout-bug"/> +</xsl:template> + +<xsl:template match="co" mode="conumber"> + <xsl:number from="literallayout|programlisting|screen|synopsis" + level="single" + format="1"/> +</xsl:template> + +<xsl:template match="book" mode="xref-to"> + <xsl:param name="target" select="."/> + <xsl:param name="refelem" select="local-name($target)"/> + + <xsl:variable name="title"> + <xsl:choose> + <xsl:when test="$target/title"> + <xsl:apply-templates select="$target/title" mode="xref"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="$target/bookinfo/title" + mode="xref"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <i> + <xsl:copy-of select="$title"/> + </i> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="link"> + <xsl:variable name="targets" select="id(@linkend)"/> + <xsl:variable name="target" select="$targets[1]"/> + + <xsl:call-template name="check.id.unique"> + <xsl:with-param name="linkend" select="@linkend"/> + </xsl:call-template> + + <a> + <xsl:if test="@id"> + <xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute> + </xsl:if> + + <xsl:attribute name="href"> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$target"/> + </xsl:call-template> + </xsl:attribute> + + <xsl:apply-templates/> + </a> +</xsl:template> + +<xsl:template match="ulink"> + <a> + <xsl:if test="@id"> + <xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute> + </xsl:if> + <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute> + <xsl:if test="$ulink.target != ''"> + <xsl:attribute name="target"> + <xsl:value-of select="$ulink.target"/> + </xsl:attribute> + </xsl:if> + <xsl:choose> + <xsl:when test="count(child::node())=0"> + <xsl:value-of select="@url"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> + </a> +</xsl:template> + +<xsl:template match="olink"> + <xsl:if test="@id"> + <a name="{@id}"/> + </xsl:if> + <xsl:apply-templates/> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template name="title.xref"> + <xsl:param name="target" select="."/> + <xsl:choose> + <xsl:when test="local-name($target) = 'figure' + or local-name($target) = 'example' + or local-name($target) = 'equation' + or local-name($target) = 'table' + or local-name($target) = 'dedication' + or local-name($target) = 'preface' + or local-name($target) = 'bibliography' + or local-name($target) = 'glossary' + or local-name($target) = 'index' + or local-name($target) = 'setindex' + or local-name($target) = 'colophon'"> + <xsl:call-template name="gentext.startquote"/> + <xsl:apply-templates select="$target" mode="title.content"/> + <xsl:call-template name="gentext.endquote"/> + </xsl:when> + <xsl:otherwise> + <i> + <xsl:apply-templates select="$target" mode="title.content"/> + </i> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="number.xref"> + <xsl:param name="target" select="."/> + <xsl:apply-templates select="$target" mode="label.content"/> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template name="xref.xreflabel"> + <!-- called to process an xreflabel...you might use this to make --> + <!-- xreflabels come out in the right font for different targets, --> + <!-- for example. --> + <xsl:param name="target" select="."/> + <xsl:value-of select="$target/@xreflabel"/> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="title" mode="xref"> + <xsl:apply-templates/> +</xsl:template> + +<xsl:template match="command" mode="xref"> + <xsl:call-template name="inline.boldseq"/> +</xsl:template> + +<xsl:template match="function" mode="xref"> + <xsl:call-template name="inline.monoseq"/> +</xsl:template> + +</xsl:stylesheet> diff --git a/tests/docbook/html/xtchunk.xsl b/tests/docbook/html/xtchunk.xsl new file mode 100644 index 00000000..aeb41b56 --- /dev/null +++ b/tests/docbook/html/xtchunk.xsl @@ -0,0 +1,36 @@ +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:xt="http://www.jclark.com/xt" + extension-element-prefixes="xt" + version="1.0"> + +<xsl:include href="chunk-common.xsl"/> + +<xsl:template name="make-relative-filename"> + <xsl:param name="base.dir" select="'./'"/> + <xsl:param name="base.name" select="''"/> + + <!-- XT makes chunks relative --> + <xsl:choose> + <xsl:when test="count(parent::*) = 0"> + <xsl:value-of select="concat($base.dir,$base.name)"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$base.name"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template name="write.chunk"> + <xsl:param name="filename" select="''"/> + <xsl:param name="method" select="'html'"/> + <xsl:param name="encoding" select="'ISO-8859-1'"/> + <xsl:param name="content" select="''"/> + + <xt:document href="{$filename}" + method="{$method}" + encoding="{$encoding}"> + <xsl:copy-of select="$content"/> + </xt:document> +</xsl:template> + +</xsl:stylesheet>
\ No newline at end of file |