← all demos
xsl:stylesheet(
    exclude-result-prefixes="exsl d",
    version="1.0",
    xmlns:d="http://docbook.org/ns/docbook",
    xmlns:exsl="http://exslt.org/common",
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform")
  xsl:output(encoding="ISO-8859-1", indent="no", method="html")
  xsl:include(href="../VERSION.xsl")
  xsl:include(href="param.xsl")
  xsl:include(href="../lib/lib.xsl")
  xsl:include(href="../common/l10n.xsl")
  xsl:include(href="../common/common.xsl")
  xsl:include(href="../common/utility.xsl")
  xsl:include(href="../common/labels.xsl")
  xsl:include(href="../common/titles.xsl")
  xsl:include(href="../common/subtitles.xsl")
  xsl:include(href="../common/gentext.xsl")
  xsl:include(href="../common/targets.xsl")
  xsl:include(href="../common/olink.xsl")
  xsl:include(href="../common/pi.xsl")
  xsl:include(href="autotoc.xsl")
  xsl:include(href="autoidx.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="htmltbl.xsl")
  xsl:include(href="sections.xsl")
  xsl:include(href="inline.xsl")
  xsl:include(href="footnote.xsl")
  xsl:include(href="html.xsl")
  xsl:include(href="its.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="biblio-iso690.xsl")
  xsl:include(href="glossary.xsl")
  xsl:include(href="block.xsl")
  xsl:include(href="task.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="pi.xsl")
  xsl:include(href="ebnf.xsl")
  xsl:include(href="chunker.xsl")
  xsl:include(href="html-rtf.xsl")
  xsl:include(href="annotations.xsl")
  xsl:include(href="../common/addns.xsl")
  xsl:include(href="publishers.xsl")
  param stylesheet.result.type := 'html'
  param htmlhelp.output := 0
  xsl:key(match="*", name="id", use="@id|@xml:id")
  xsl:key(match="*", name="gid", use="generate-id()")
  match *:
    xsl:message
      "Element"
      <- local-name(.)
      "in namespace '"
      <- namespace-uri(.)
      "' encountered"
      if parent::*:
        "in"
        <- name(parent::*)
      ", but no template matches."
    span(style="color: red")
      "<"
      <- name(.)
      ">"
      apply
      "</"
      <- name(.)
      ">"
  match text():
    <- .
  template body.attributes:
    @bgcolor = white
    @text = black
    @link = #0000FF
    @vlink = #840084
    @alink = #0000FF
    if starts-with($writing.mode, 'rl'):
      @dir = rtl
  template head.content.base(node := .):
    base(href="{$html.base}")
  template head.content.abstract(node := .):
    info := (d:articleinfo
    |d:bookinfo
    |d:prefaceinfo
    |d:chapterinfo
    |d:appendixinfo
    |d:sectioninfo
    |d:sect1info
    |d:sect2info
    |d:sect3info
    |d:sect4info
    |d:sect5info
    |d:referenceinfo
    |d:refentryinfo
    |d:partinfo
    |d:info
    |d:docinfo)[1]
    if $info and $info/d:abstract:
      meta(name="description")
        @content
          foreach $info/d:abstract[1]/*:
            <- normalize-space(.)
            if position() < last():
  template head.content.link.made(node := .):
    link(href="{$link.mailto.url}", rev="made")
  template head.content.generator(node := .):
    meta(content="DocBook {$DistroTitle} V{$VERSION}", name="generator")
  template head.content.style(node := .):
    style(type="text/css")
      "body { background-image: url('"
      <- $draft.watermark.image
      "');
       background-repeat: no-repeat;
       background-position: top left;
       /* The following properties make the watermark "fixed" on the page. */
       /* I think that's just a bit too distracting for the reader... */
       /* background-attachment: fixed; */
       /* background-position: center center; */
     }"
  template head.content:
    param node := .
    param title :=
      apply $node
    call user.head.title:
      title := $title
      node := $node
    if $html.base != '':
      call head.content.base:
        node := $node
    call generate.css
    if $html.stylesheet != '':
      call output.html.stylesheets:
        stylesheets := normalize-space($html.stylesheet)
    if $html.script != '':
      call output.html.scripts:
        scripts := normalize-space($html.script)
    if $link.mailto.url != '':
      call head.content.link.made:
        node := $node
    call head.content.generator:
      node := $node
    if $generate.meta.abstract != 0:
      call head.content.abstract:
        node := $node
    if ($draft.mode = 'yes' or
                ($draft.mode = 'maybe' and
                ancestor-or-self::*[@status][1]/@status = 'draft'))
                and $draft.watermark.image != '':
      call head.content.style:
        node := $node
    apply .
  template output.html.stylesheets(stylesheets := ''):
    choose:
      when contains($stylesheets, ' '):
        css.filename := substring-before($stylesheets, ' ')
        call make.css.link:
          css.filename := $css.filename
        call output.html.stylesheets:
          stylesheets := substring-after($stylesheets, ' ')
      when $stylesheets != '':
        call make.css.link:
          css.filename := $stylesheets
  template output.html.scripts(scripts := ''):
    choose:
      when contains($scripts, ' '):
        script.filename := substring-before($scripts, ' ')
        call make.script.link:
          script.filename := $script.filename
        call output.html.scripts:
          scripts := substring-after($scripts, ' ')
      when $scripts != '':
        call make.script.link:
          script.filename := $scripts
  match * (mode="head.keywords.content"):
    apply d:chapterinfo/d:keywordset
    apply d:appendixinfo/d:keywordset
    apply d:prefaceinfo/d:keywordset
    apply d:bookinfo/d:keywordset
    apply d:setinfo/d:keywordset
    apply d:articleinfo/d:keywordset
    apply d:artheader/d:keywordset
    apply d:sect1info/d:keywordset
    apply d:sect2info/d:keywordset
    apply d:sect3info/d:keywordset
    apply d:sect4info/d:keywordset
    apply d:sect5info/d:keywordset
    apply d:sectioninfo/d:keywordset
    apply d:refsect1info/d:keywordset
    apply d:refsect2info/d:keywordset
    apply d:refsect3info/d:keywordset
    apply d:bibliographyinfo/d:keywordset
    apply d:glossaryinfo/d:keywordset
    apply d:indexinfo/d:keywordset
    apply d:refentryinfo/d:keywordset
    apply d:partinfo/d:keywordset
    apply d:referenceinfo/d:keywordset
    apply d:docinfo/d:keywordset
    apply d:info/d:keywordset
    if $inherit.keywords != 0
                and parent::*:
      apply parent::*
  template system.head.content(node := .):
    if $annotation.support != 0 and //d:annotation:
      call add.annotation.links
      script(type="text/javascript")
        "// Create PopupWindow objects"
        foreach //d:annotation:
          "var popup_"
          <- generate-id(.)
          "= new PopupWindow("popup-"
          <- generate-id(.)
          "");"
          "popup_"
          <- generate-id(.)
          ".offsetY = 15;"
          "popup_"
          <- generate-id(.)
          ".autoHide();"
      style(type="text/css")
        <- $annotation.css
  template user.preroot:
  template user.head.title(node := ., title):
    title
      copy $title
  template user.head.content(node := .):
  template user.header.navigation(node := ., prev := /d:foo, next := /d:foo, nav.context):
  template user.header.content(node := .):
  template user.footer.content(node := .):
  template user.footer.navigation(node := ., prev := /d:foo, next := /d:foo, nav.context):
  with.namespace :=
    if $exsl.node.set.available != 0 and 
                namespace-uri(/*) != 'http://docbook.org/ns/docbook':
      apply /*
  match /:
    doc.title :=
      call get.doc.title
    choose:
      when $exsl.node.set.available != 0 and 
                  namespace-uri(/*) != 'http://docbook.org/ns/docbook':
        call log.message:
          level := Note
          source := $doc.title
          context-desc :=
            "namesp. add"
          message :=
            "added namespace before processing"
        apply exsl:node-set($with.namespace)
      when namespace-uri(/*) != 'http://docbook.org/ns/docbook':
        xsl:message(terminate="yes")
          "Unable to add the namespace from DB4 document,"
          "cannot proceed."
      else:
        choose:
          when $rootid != '':
            choose:
              when count(key('id',$rootid)) = 0:
                xsl:message(terminate="yes")
                  "ID '"
                  <- $rootid
                  "' not found in document."
              else:
                if $collect.xref.targets = 'yes' or
                            $collect.xref.targets = 'only':
                  apply key('id', $rootid)
                if $collect.xref.targets != 'only':
                  apply key('id',$rootid)
                  if $tex.math.in.alt != '':
                    apply key('id',$rootid)
          else:
            if $collect.xref.targets = 'yes' or
                        $collect.xref.targets = 'only':
              apply /
            if $collect.xref.targets != 'only':
              apply /
              if $tex.math.in.alt != '':
                apply /
  match * (mode="process.root"):
    doc := self::*
    call user.preroot
    call root.messages
    html
      call root.attributes
      head
        call system.head.content:
          node := $doc
        call head.content:
          node := $doc
        call user.head.content:
          node := $doc
      body
        call body.attributes
        call user.header.content:
          node := $doc
        apply .
        call user.footer.content:
          node := $doc
    <- $html.append
    call generate.css.files
  template root.attributes:
  template root.messages:
  template chunk(node := .):
    "0"