+<?xml version="1.0" encoding="UTF-8"?>\r
+<xsl:stylesheet\r
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\r
+ xmlns:exsl="http://exslt.org/common"\r
+ extension-element-prefixes="exsl"\r
+ exclude-result-prefixes="exsl"\r
+ version="1.0">\r
+\r
+ <xsl:output\r
+ method="xml" indent="yes"\r
+ doctype-public="-//OASIS//DTD DocBook XML V4.5//EN"\r
+ doctype-system="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"/>\r
+\r
+ <xsl:template name="write.api.overview.contents">\r
+\r
+ <xsl:if test="count(ancestor::*/sectiondef[memberdef/@kind = 'variable' or memberdef/@kind = 'typedef']) > 0">\r
+ <section>\r
+ <title>Variable and Type Definitions</title>\r
+\r
+ <xsl:for-each select="ancestor::*/sectiondef[memberdef/@kind = 'variable' or memberdef/@kind = 'typedef']">\r
+ <section>\r
+ <title>\r
+ <xsl:value-of select="header"/>\r
+ </title>\r
+\r
+ <xsl:apply-templates select="description"/>\r
+ <xsl:apply-templates select="memberdef[@kind = 'variable' or @kind = 'typedef']"/>\r
+ </section>\r
+ </xsl:for-each>\r
+ </section>\r
+ </xsl:if>\r
+\r
+ <xsl:if test="count(ancestor::*/innerclass) > 0">\r
+ <section>\r
+ <title>Structure Definitions</title>\r
+\r
+ <xsl:for-each select="ancestor::*/innerclass">\r
+ <xsl:apply-templates select="ancestor::*/compounddef[@id = current()/@refid]"/>\r
+ </xsl:for-each>\r
+ </section>\r
+ </xsl:if>\r
+\r
+ <xsl:if test="count(ancestor::*/sectiondef[memberdef/@kind = 'define' or @kind = 'define']) > 0">\r
+ <section>\r
+ <title>Macro Definitions</title>\r
+\r
+ <xsl:for-each select="ancestor::*/sectiondef[memberdef/@kind = 'define' or @kind = 'define']">\r
+ <section>\r
+ <title>\r
+ <xsl:value-of select="header"/>\r
+ </title>\r
+\r
+ <xsl:apply-templates select="description"/>\r
+ <xsl:apply-templates select="memberdef[@kind = 'define']"/>\r
+ </section>\r
+ </xsl:for-each>\r
+ </section>\r
+ </xsl:if>\r
+\r
+ <xsl:if test="count(ancestor::*/sectiondef[memberdef/@kind = 'function']) > 0">\r
+ <section>\r
+ <title>Function Definitions</title>\r
+\r
+ <xsl:for-each select="ancestor::*/sectiondef[memberdef/@kind = 'function']">\r
+ <section>\r
+ <title>\r
+ <xsl:value-of select="header"/>\r
+ </title>\r
+\r
+ <xsl:apply-templates select="description"/>\r
+ <xsl:apply-templates select="memberdef[@kind = 'function']"/>\r
+ </section>\r
+ </xsl:for-each>\r
+ </section>\r
+ </xsl:if>\r
+\r
+ <xsl:if test="count(ancestor::*/sectiondef[@kind = 'enum']) > 0">\r
+ <section>\r
+ <title>Enumeration Definitions</title>\r
+\r
+ <xsl:apply-templates select="ancestor::*/sectiondef[@kind = 'enum']"/>\r
+ </section>\r
+ </xsl:if>\r
+\r
+ </xsl:template>\r
+\r
+ <xsl:template match="compounddef">\r
+ <!-- Discard compounddef elements unless a later template matches -->\r
+ </xsl:template>\r
+\r
+ <xsl:template match="compounddef[@kind = 'struct' or @kind = 'union']">\r
+ <section id="{@id}" xreflabel="{compoundname}">\r
+ <title>\r
+ <xsl:choose>\r
+ <xsl:when test="@kind = 'struct'">\r
+ <xsl:text>Struct </xsl:text>\r
+ </xsl:when>\r
+ <xsl:when test="@kind = 'union'">\r
+ <xsl:text>Union </xsl:text>\r
+ </xsl:when>\r
+ </xsl:choose>\r
+\r
+ <xsl:value-of select="compoundname"/>\r
+ </title>\r
+\r
+ <xsl:apply-templates select="detaileddescription"/>\r
+\r
+ <xsl:for-each select="sectiondef[@kind = 'public-attrib']">\r
+ <informaltable tabstyle="striped">\r
+ <tgroup cols="3">\r
+ <thead>\r
+ <row>\r
+ <entry>Type</entry>\r
+ <entry>Name</entry>\r
+ <entry>Description</entry>\r
+ </row>\r
+ </thead>\r
+ <tbody>\r
+ <xsl:for-each select="memberdef">\r
+ <row id="{@id}" xreflabel="{name}">\r
+ <entry>\r
+ <xsl:apply-templates select="type"/>\r
+ </entry>\r
+ <entry>\r
+ <xsl:value-of select="name"/>\r
+ <xsl:if test="starts-with(argsstring, '[')">\r
+ <xsl:text>[]</xsl:text>\r
+ </xsl:if>\r
+ </entry>\r
+ <entry>\r
+ <xsl:apply-templates select="detaileddescription" mode="struct"/>\r
+ </entry>\r
+ </row>\r
+ </xsl:for-each>\r
+ </tbody>\r
+ </tgroup>\r
+ </informaltable>\r
+ <para> </para>\r
+ </xsl:for-each>\r
+ </section>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="memberdef[@kind = 'function']">\r
+ <section id="{@id}" xreflabel="{name}">\r
+ <title> Function <xsl:value-of select="name"/>() </title>\r
+\r
+ <para>\r
+ <emphasis role="italic">\r
+ <xsl:value-of select="briefdescription"/>\r
+ </emphasis>\r
+ </para>\r
+\r
+ <programlisting language="c">\r
+ <xsl:value-of select="definition"/>\r
+ <xsl:text> 		</xsl:text>\r
+ <xsl:apply-templates select="argsstring"/>\r
+ </programlisting>\r
+\r
+ <xsl:apply-templates select="detaileddescription"/>\r
+\r
+ <para> </para>\r
+ </section>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="memberdef[@kind = 'enum']">\r
+ <section id="{@id}" xreflabel="{name}">\r
+ <title> Enum <xsl:value-of select="name"/> </title>\r
+\r
+ <xsl:apply-templates select="detaileddescription"/>\r
+\r
+ <informaltable tabstyle="striped">\r
+ <tgroup cols="2">\r
+ <thead>\r
+ <row>\r
+ <entry>Enum Value</entry>\r
+ <entry>Description</entry>\r
+ </row>\r
+ </thead>\r
+ <tbody>\r
+ <xsl:for-each select="enumvalue">\r
+ <row>\r
+ <entry>\r
+ <para id="{@id}" xreflabel="{name}">\r
+ <xsl:value-of select="name"/>\r
+ </para>\r
+ </entry>\r
+ <entry>\r
+ <xsl:apply-templates select="detaileddescription"/>\r
+ </entry>\r
+ </row>\r
+ </xsl:for-each>\r
+ </tbody>\r
+ </tgroup>\r
+ </informaltable>\r
+\r
+ <para> </para>\r
+ </section>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="memberdef[@kind = 'define']">\r
+ <section id="{@id}" xreflabel="{name}">\r
+ <title> Macro <xsl:value-of select="name"/> </title>\r
+\r
+ <programlisting language="c">\r
+ <xsl:text>#define </xsl:text>\r
+ <xsl:value-of select="name"/>\r
+ <xsl:if test="count(param) > 0">\r
+ <xsl:text>(</xsl:text>\r
+ <xsl:for-each select="param/defname">\r
+ <xsl:if test="position() > 1">\r
+ <xsl:text>, </xsl:text>\r
+ </xsl:if>\r
+ <xsl:value-of select="."/>\r
+ </xsl:for-each>\r
+ <xsl:text>)</xsl:text>\r
+ </xsl:if>\r
+ <xsl:text> </xsl:text>\r
+\r
+ <!-- Split long macro definitions across multiple lines -->\r
+ <xsl:if test="(string-length(initializer) > 50) or (count(param) > 0)">\r
+ <xsl:text>\ 		</xsl:text>\r
+ </xsl:if>\r
+\r
+ <xsl:value-of select="initializer"/>\r
+ </programlisting>\r
+\r
+ <xsl:apply-templates select="detaileddescription"/>\r
+\r
+ <para> </para>\r
+ </section>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="memberdef[@kind = 'variable' or @kind = 'typedef']">\r
+ <section id="{@id}" xreflabel="{name}">\r
+ <title>\r
+ <!-- Doxygen gets confused and thinks function pointer type definitions\r
+ are variables, so we need to map them to this common section and\r
+ check the definition to see which of the two it is. -->\r
+ <xsl:choose>\r
+ <xsl:when test="contains(definition,'typedef')">\r
+ <xsl:text>Type </xsl:text>\r
+ </xsl:when>\r
+\r
+ <xsl:otherwise>\r
+ <xsl:text>Variable </xsl:text>\r
+ </xsl:otherwise>\r
+ </xsl:choose>\r
+\r
+ <xsl:value-of select="name"/>\r
+ </title>\r
+\r
+ <programlisting language="c">\r
+ <xsl:value-of select="definition"/>\r
+ </programlisting>\r
+\r
+ <xsl:apply-templates select="detaileddescription"/>\r
+\r
+ <para> </para>\r
+ </section>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="sectiondef">\r
+ <para>\r
+ <xsl:value-of select="description"/>\r
+ </para>\r
+\r
+ <xsl:apply-templates select="memberdef"/>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="simplesect" mode="struct">\r
+ <footnote>\r
+ <xsl:apply-templates select="para"/>\r
+ </footnote>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="simplesect">\r
+ <xsl:choose>\r
+ <xsl:when test="@kind = 'warning'">\r
+ <warning>\r
+ <title>Warning</title>\r
+ <xsl:apply-templates select="para"/>\r
+ </warning>\r
+ </xsl:when>\r
+\r
+ <xsl:when test="@kind = 'return'">\r
+ <note>\r
+ <title>Returns</title>\r
+ <xsl:apply-templates select="para"/>\r
+ </note>\r
+ </xsl:when>\r
+\r
+ <xsl:when test="@kind = 'pre'">\r
+ <note>\r
+ <title>Precondition</title>\r
+ <xsl:apply-templates select="para"/>\r
+ </note>\r
+ </xsl:when>\r
+\r
+ <xsl:when test="@kind = 'par'">\r
+ <note>\r
+ <title>\r
+ <xsl:value-of select="title"/>\r
+ </title>\r
+ <xsl:apply-templates select="para"/>\r
+ </note>\r
+ </xsl:when>\r
+\r
+ <xsl:when test="@kind = 'see'">\r
+ <note>\r
+ <title>See also</title>\r
+ <xsl:apply-templates select="para"/>\r
+ </note>\r
+ </xsl:when>\r
+\r
+ <xsl:when test="@kind = 'note'">\r
+ <!-- Notes can have special prefix keywords to transform them into\r
+ special styles for training documents ("AlfonsoNotes(TM)") -->\r
+ <xsl:variable name="note.prefix" select="substring-before(para[1]/text(), ' ')"/>\r
+\r
+ <note>\r
+ <xsl:choose>\r
+ <xsl:when test="$note.prefix = 'TODO:'">\r
+ <xsl:attribute name="role">todo</xsl:attribute>\r
+ <title>To Do</title>\r
+ </xsl:when>\r
+\r
+ <xsl:when test="$note.prefix = 'TIP:'">\r
+ <xsl:attribute name="role">tip</xsl:attribute>\r
+ <title>Tip</title>\r
+ </xsl:when>\r
+\r
+ <xsl:when test="$note.prefix = 'INFO:'">\r
+ <xsl:attribute name="role">info</xsl:attribute>\r
+ <title>Info</title>\r
+ </xsl:when>\r
+\r
+ <xsl:when test="$note.prefix = 'RESULT:'">\r
+ <xsl:attribute name="role">result</xsl:attribute>\r
+ <title>Result</title>\r
+ </xsl:when>\r
+\r
+ <xsl:when test="$note.prefix = 'EXECUTE:'">\r
+ <xsl:attribute name="role">execute</xsl:attribute>\r
+ <title>Execute</title>\r
+ </xsl:when>\r
+\r
+ <xsl:when test="$note.prefix = 'WARNING:'">\r
+ <xsl:attribute name="role">warning</xsl:attribute>\r
+ <title>Warning</title>\r
+ </xsl:when>\r
+\r
+ <xsl:otherwise/>\r
+ </xsl:choose>\r
+\r
+ <xsl:apply-templates select="para"/>\r
+ </note>\r
+ </xsl:when>\r
+\r
+ </xsl:choose>\r
+ </xsl:template>\r
+\r
+ <!-- Strip off the special note type prefix from the special training document\r
+ style notes ("AlfonsoNotes(TM)") if one is present. -->\r
+ <xsl:template match="para[parent::simplesect/@kind='note']/text()">\r
+ <xsl:variable name="note.prefix" select="substring-before(., ' ')"/>\r
+ <xsl:variable name="note.content" select="substring-after(., ' ')"/>\r
+\r
+ <xsl:choose>\r
+ <xsl:when test="$note.prefix = 'TODO:'">\r
+ <xsl:value-of select="$note.content"/>\r
+ </xsl:when>\r
+\r
+ <xsl:when test="$note.prefix = 'TIP:'">\r
+ <xsl:value-of select="$note.content"/>\r
+ </xsl:when>\r
+\r
+ <xsl:when test="$note.prefix = 'INFO:'">\r
+ <xsl:value-of select="$note.content"/>\r
+ </xsl:when>\r
+\r
+ <xsl:when test="$note.prefix = 'RESULT:'">\r
+ <xsl:value-of select="$note.content"/>\r
+ </xsl:when>\r
+\r
+ <xsl:when test="$note.prefix = 'EXECUTE:'">\r
+ <xsl:value-of select="$note.content"/>\r
+ </xsl:when>\r
+\r
+ <xsl:when test="$note.prefix = 'WARNING:'">\r
+ <xsl:value-of select="$note.content"/>\r
+ </xsl:when>\r
+\r
+ <xsl:otherwise>\r
+ <xsl:value-of select="."/>\r
+ </xsl:otherwise>\r
+ </xsl:choose>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="parameterlist[@kind = 'param']">\r
+ <table tabstyle="striped">\r
+ <title>Parameters</title>\r
+ <tgroup cols="3">\r
+ <thead>\r
+ <row>\r
+ <entry>Data Direction</entry>\r
+ <entry>Parameter Name</entry>\r
+ <entry>Description</entry>\r
+ </row>\r
+ </thead>\r
+ <tbody>\r
+ <xsl:for-each select="parameteritem">\r
+ <row>\r
+ <xsl:apply-templates select="."/>\r
+ </row>\r
+ </xsl:for-each>\r
+ </tbody>\r
+ </tgroup>\r
+ </table>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="parameterlist[@kind = 'retval']">\r
+ <table tabstyle="striped">\r
+ <title>Return Values</title>\r
+ <tgroup cols="2">\r
+ <thead>\r
+ <row>\r
+ <entry>Return Value</entry>\r
+ <entry>Description</entry>\r
+ </row>\r
+ </thead>\r
+ <tbody>\r
+ <xsl:for-each select="parameteritem">\r
+ <row>\r
+ <xsl:apply-templates select="."/>\r
+ </row>\r
+ </xsl:for-each>\r
+ </tbody>\r
+ </tgroup>\r
+ </table>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="parameteritem">\r
+ <xsl:if test="parent::parameterlist/@kind = 'param'">\r
+ <entry>\r
+ <para>\r
+ <xsl:choose>\r
+ <xsl:when test="not(descendant::parametername/@direction)">\r
+ <emphasis role="italic">?</emphasis>\r
+ </xsl:when>\r
+ <xsl:otherwise>\r
+ <emphasis role="bold">[<xsl:value-of select="descendant::parametername/@direction"/>]</emphasis>\r
+ </xsl:otherwise>\r
+ </xsl:choose>\r
+ </para>\r
+ </entry>\r
+ </xsl:if>\r
+\r
+ <entry>\r
+ <para>\r
+ <xsl:value-of select="parameternamelist/parametername"/>\r
+ </para>\r
+ </entry>\r
+\r
+ <entry>\r
+ <xsl:apply-templates select="parameterdescription"/>\r
+ </entry>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="type">\r
+ <xsl:apply-templates/>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="sect1">\r
+ <section id="{@id}" xreflabel="{title}">\r
+ <title>\r
+ <xsl:value-of select="title"/>\r
+ </title>\r
+\r
+ <xsl:apply-templates select="para"/>\r
+ <xsl:apply-templates select="sect2"/>\r
+ </section>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="sect2">\r
+ <section id="{@id}" xreflabel="{title}">\r
+ <title>\r
+ <xsl:value-of select="title"/>\r
+ </title>\r
+\r
+ <xsl:apply-templates select="para"/>\r
+ <xsl:apply-templates select="sect3"/>\r
+ </section>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="sect3">\r
+ <section id="{@id}" xreflabel="{title}">\r
+ <title>\r
+ <xsl:value-of select="title"/>\r
+ </title>\r
+\r
+ <xsl:apply-templates select="para"/>\r
+ </section>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="detaileddescription">\r
+ <xsl:apply-templates select="para"/>\r
+ <xsl:apply-templates select="sect1"/>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="para">\r
+ <para>\r
+ <xsl:apply-templates/>\r
+ </para>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="bold">\r
+ <emphasis role="bold">\r
+ <xsl:value-of select="."/>\r
+ </emphasis>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="emphasis">\r
+ <emphasis role="italic">\r
+ <xsl:value-of select="."/>\r
+ </emphasis>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="computeroutput">\r
+ <computeroutput>\r
+ <xsl:value-of select="."/>\r
+ </computeroutput>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="ulink">\r
+ <ulink url="{@url}">\r
+ <xsl:value-of select="."/>\r
+ </ulink>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="registered">\r
+ <xsl:text>®</xsl:text>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="copy">\r
+ <xsl:text>©</xsl:text>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="trademark">\r
+ <xsl:text>™</xsl:text>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="ref">\r
+ <xsl:choose>\r
+ <!-- Don't show links inside program listings -->\r
+ <xsl:when test="ancestor::programlisting">\r
+ <xsl:value-of select="."/>\r
+ </xsl:when>\r
+\r
+ <!-- Show links outside program listings -->\r
+ <xsl:otherwise>\r
+ <link linkend="{@refid}" xrefstyle="nopage">\r
+ <xsl:value-of select="text()"/>\r
+ </link>\r
+ </xsl:otherwise>\r
+ </xsl:choose>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="formula">\r
+ <equation>\r
+ <!-- LaTeX equation generation requires JLatexMath and its associated\r
+ FOP plugin, or you will get missing equations in the output -->\r
+ <latex align="center" xmlns="http://forge.scilab.org/p/jlatexmath">\r
+ <xsl:value-of select="."/>\r
+ </latex>\r
+ </equation>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="table">\r
+ <xsl:choose>\r
+ <xsl:when test="caption">\r
+ <table tabstyle="striped">\r
+ <title>\r
+ <xsl:value-of select="caption"/>\r
+ </title>\r
+ <xsl:call-template name="write.table.content"/>\r
+ </table>\r
+ </xsl:when>\r
+ <xsl:otherwise>\r
+ <informaltable tabstyle="striped">\r
+ <xsl:call-template name="write.table.content"/>\r
+ </informaltable>\r
+ </xsl:otherwise>\r
+ </xsl:choose>\r
+ </xsl:template>\r
+\r
+ <xsl:template name="write.table.content">\r
+ <tgroup cols="{@cols}">\r
+ <thead>\r
+ <xsl:for-each select="row[1]">\r
+ <row>\r
+ <xsl:for-each select="entry">\r
+ <entry>\r
+ <xsl:apply-templates select="."/>\r
+ </entry>\r
+ </xsl:for-each>\r
+ </row>\r
+ </xsl:for-each>\r
+ </thead>\r
+ <tbody>\r
+ <xsl:for-each select="row[position() != 1]">\r
+ <row>\r
+ <xsl:for-each select="entry">\r
+ <entry>\r
+ <xsl:apply-templates select="."/>\r
+ </entry>\r
+ </xsl:for-each>\r
+ </row>\r
+ </xsl:for-each>\r
+ </tbody>\r
+ </tgroup>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="itemizedlist">\r
+ <itemizedlist>\r
+ <xsl:apply-templates select="listitem"/>\r
+ </itemizedlist>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="orderedlist">\r
+ <orderedlist>\r
+ <xsl:apply-templates select="listitem"/>\r
+ </orderedlist>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="listitem">\r
+ <listitem>\r
+ <xsl:apply-templates/>\r
+ </listitem>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="programlisting">\r
+ <programlisting language="c">\r
+ <xsl:for-each select="codeline[position() > 1 or highlight]">\r
+ <xsl:apply-templates select="."/>\r
+ <xsl:text> </xsl:text>\r
+ </xsl:for-each>\r
+ </programlisting>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="highlight">\r
+ <emphasis>\r
+ <xsl:attribute name="role">\r
+ <xsl:value-of select="@class"/>\r
+ </xsl:attribute>\r
+ <xsl:apply-templates/>\r
+ </emphasis>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="sp[ancestor::codeline]">\r
+ <xsl:choose>\r
+ <!-- Need to check if this is the first part of the line - if so we may\r
+ need to strip off any leading <sp/> element indentation -->\r
+ <xsl:when test="ancestor::highlight = ancestor::codeline/highlight[1]">\r
+ <!-- Doxygen retains a level of indentation in some code fragments - obtain\r
+ the base indentation level by counting the leading <sp/> elements of the\r
+ first code line, and use that to remove the indentation on the rest -->\r
+ <xsl:variable name="leading.spaces" select="count(ancestor::programlisting/codeline[highlight][1]/highlight[1]/sp[not(preceding-sibling::text())])"/>\r
+\r
+ <xsl:if test="position() > $leading.spaces">\r
+ <xsl:text> </xsl:text>\r
+ </xsl:if>\r
+ </xsl:when>\r
+\r
+ <xsl:otherwise>\r
+ <xsl:text> </xsl:text>\r
+ </xsl:otherwise>\r
+ </xsl:choose>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="image">\r
+ <figure>\r
+ <title>\r
+ <xsl:value-of select="."/>\r
+ </title>\r
+\r
+ <mediaobject>\r
+ <imageobject>\r
+ <imagedata scalefit="1" width="{@width}">\r
+ <xsl:attribute name="fileref">html/<xsl:value-of select="@name"/></xsl:attribute>\r
+ </imagedata>\r
+ </imageobject>\r
+ </mediaobject>\r
+ </figure>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="anchor">\r
+ <anchor id="{@id}"/>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="dot">\r
+ <!-- We get raw DOT syntax rather than a rendered image: write the DOT code\r
+ to a new unique file, and make a image reference to a SVG version of\r
+ that file. The build system should then call dot to render all generated\r
+ DOT files into their SVG equivalents before rendering the PDF. -->\r
+ <xsl:variable name="filename" select="generate-id(.)" />\r
+ <exsl:document href="{$filename}.dot" method="text">\r
+ <xsl:value-of select="." />\r
+ </exsl:document>\r
+\r
+ <figure>\r
+ <title>\r
+ <xsl:value-of select="ancestor::*/title"/>\r
+ </title>\r
+ <mediaobject>\r
+ <imageobject>\r
+ <imagedata format="SVG">\r
+ <xsl:attribute name="fileref">\r
+ <xsl:value-of select="$filename" />\r
+ <xsl:text>.svg</xsl:text>\r
+ </xsl:attribute>\r
+ </imagedata>\r
+ </imageobject>\r
+ </mediaobject>\r
+ </figure>\r
+ </xsl:template>\r
+\r
+ <xsl:template match="argsstring" name="split.functions.args">\r
+ <xsl:param name="text" select="."/>\r
+ <xsl:value-of select="substring-before(concat($text,','),',')"/>\r
+ <xsl:if test="contains($text,',')">\r
+ <xsl:text>, 		</xsl:text>\r
+ <xsl:call-template name="split.functions.args">\r
+ <xsl:with-param name="text" select="substring-after($text,',')"/>\r
+ </xsl:call-template>\r
+ </xsl:if>\r
+ </xsl:template>\r
+</xsl:stylesheet>\r