diff options
author | Matthew Burgess <matthew@linuxfromscratch.org> | 2013-10-08 20:03:29 +0000 |
---|---|---|
committer | Matthew Burgess <matthew@linuxfromscratch.org> | 2013-10-08 20:03:29 +0000 |
commit | 15c7d39533a1eb1da0748011f3378fd0f02ed14d (patch) | |
tree | a7ed12df60c5ffd4d00a570804c51470bfb8b0f5 /stylesheets/lfs-xsl/docbook-xsl-1.78.1/slides/tools/dbs3-upgrade.xsl | |
parent | 09a35dd7178070f01a7961d2ded39e11ba2aac83 (diff) |
Update stylesheets to docbook-xsl-1.78.1.
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10355 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'stylesheets/lfs-xsl/docbook-xsl-1.78.1/slides/tools/dbs3-upgrade.xsl')
-rw-r--r-- | stylesheets/lfs-xsl/docbook-xsl-1.78.1/slides/tools/dbs3-upgrade.xsl | 180 |
1 files changed, 180 insertions, 0 deletions
diff --git a/stylesheets/lfs-xsl/docbook-xsl-1.78.1/slides/tools/dbs3-upgrade.xsl b/stylesheets/lfs-xsl/docbook-xsl-1.78.1/slides/tools/dbs3-upgrade.xsl new file mode 100644 index 000000000..e757c9781 --- /dev/null +++ b/stylesheets/lfs-xsl/docbook-xsl-1.78.1/slides/tools/dbs3-upgrade.xsl @@ -0,0 +1,180 @@ +<?xml version="1.0" encoding="ASCII"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns="http://docbook.org/ns/docbook" + xmlns:dbs="http://docbook.org/ns/docbook-slides" + xmlns:xlink="http://www.w3.org/1999/xlink" + version="1.0"> + +<xsl:output method="xml" encoding="utf-8" indent="no"/> + +<xsl:preserve-space elements="*"/> + +<xsl:template match="/slides"> + <dbs:slides> + <xsl:call-template name="process.content"/> + </dbs:slides> +</xsl:template> + +<xsl:template name="process.content"> + <xsl:apply-templates select="slidesinfo|foilgroupinfo|foilinfo|title|titleabbrev|subtitle"/> + + <xsl:apply-templates select="speakernotes"/> + + <xsl:apply-templates select="*[not(self::speakernotes)][not(self::title)][not(self::titleabbrev)][not(self::subtitle)][not(self::slidesinfo)][not(self::foilinfo)][not(self::foilgroupinfo)]"/> +</xsl:template> + +<xsl:template match="foil"> + <dbs:foil> + <xsl:call-template name="copy.attributes"/> + + <xsl:call-template name="process.content"/> + </dbs:foil> +</xsl:template> + +<xsl:template match="foilgroup"> + <dbs:foilgroup> + <xsl:call-template name="copy.attributes"/> + + <xsl:call-template name="process.content"/> + </dbs:foilgroup> +</xsl:template> + +<xsl:template match="speakernotes"> + <dbs:speakernotes> + <xsl:call-template name="copy.attributes"/> + + <xsl:apply-templates select="*"/> + </dbs:speakernotes> +</xsl:template> + +<xsl:template match="slidesinfo|foilgroupinfo|foilinfo"> + <info> + <xsl:call-template name="copy.attributes"/> + + <xsl:apply-templates select="*"/> + </info> +</xsl:template> + +<!-- ****************************************************************** + DB4 -> DB5 related, adapted from db4-upgrade.xsl + ****************************************************************** --> + +<xsl:template name="copy.attributes"> + <xsl:param name="suppress" select="''"/> + + <xsl:for-each select="@*"> + <xsl:choose> + <xsl:when test="local-name(.) = 'lang'"> + <xsl:attribute name="xml:lang"> + <xsl:value-of select="."/> + </xsl:attribute> + </xsl:when> + <xsl:when test="local-name(.) = 'id'"> + <xsl:attribute name="xml:id"> + <xsl:value-of select="."/> + </xsl:attribute> + </xsl:when> + <xsl:when test="local-name(.) = 'moreinfo'"/> + <xsl:when test="$suppress = local-name(.)"/> + <xsl:otherwise> + <xsl:copy/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> +</xsl:template> + +<xsl:template match="*"> + <xsl:element name="{local-name()}" namespace="http://docbook.org/ns/docbook"> + <xsl:call-template name="copy.attributes"/> + + <xsl:apply-templates /> + </xsl:element> +</xsl:template> + +<xsl:template match="author[not(personname)]|editor[not(personname)]|othercredit[not(personname)]"> + <xsl:element name="{local-name()}" namespace="http://docbook.org/ns/docbook"> + <xsl:call-template name="copy.attributes"/> + + <personname> + <xsl:apply-templates select="honorific|firstname|surname|othername|lineage"/> + </personname> + + <xsl:apply-templates select="*[not(self::honorific|self::firstname|self::surname + |self::othername|self::lineage)]"/> + </xsl:element> +</xsl:template> + +<xsl:template match="address|programlisting|screen|funcsynopsisinfo + |classsynopsisinfo|literallayout"> + <xsl:element name="{local-name()}" namespace="http://docbook.org/ns/docbook"> + <xsl:call-template name="copy.attributes"> + <xsl:with-param name="suppress" select="'format'"/> + </xsl:call-template> + <xsl:apply-templates/> + </xsl:element> +</xsl:template> + +<xsl:template match="inlinegraphic[@format='linespecific']"> + <textobject> + <textdata> + <xsl:call-template name="copy.attributes"/> + </textdata> + </textobject> +</xsl:template> + +<xsl:template match="inlinegraphic"> + <inlinemediaobject> + <imageobject> + <imagedata> + <xsl:call-template name="copy.attributes"/> + </imagedata> + </imageobject> + </inlinemediaobject> +</xsl:template> + +<xsl:template match="graphic[@format='linespecific']"> + <mediaobject> + <textobject> + <textdata> + <xsl:call-template name="copy.attributes"/> + </textdata> + </textobject> + </mediaobject> +</xsl:template> + +<xsl:template match="graphic"> + <mediaobject> + <imageobject> + <imagedata> + <xsl:call-template name="copy.attributes"/> + </imagedata> + </imageobject> + </mediaobject> +</xsl:template> + +<xsl:template match="ulink" priority="200"> + <xsl:choose> + <xsl:when test="node()"> + <link xlink:href="{@url}"> + <xsl:call-template name="copy.attributes"> + <xsl:with-param name="suppress" select="'url'"/> + </xsl:call-template> + <xsl:apply-templates/> + </link> + </xsl:when> + <xsl:otherwise> + <uri xlink:href="{@url}"> + <xsl:call-template name="copy.attributes"> + <xsl:with-param name="suppress" select="'url'"/> + </xsl:call-template> + <xsl:value-of select="@url"/> + </uri> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +<xsl:template match="*[namespace-uri()]"> + <xsl:copy-of select="."/> +</xsl:template> + +</xsl:stylesheet> |