|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
xmlns:exsl="http://exslt.org/common"
|
|
Packit |
0f19cf |
version="1.0"
|
|
Packit |
0f19cf |
extension-element-prefixes="exsl">
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
XSLT Stylesheet DocBook -> LaTeX
|
|
Packit |
0f19cf |
############################################################################ -->
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
parts stripped (saxon, xalan support). We assume that exsl:document()
|
|
Packit |
0f19cf |
is supported by any XSLT now. Moreover only text file output are supported
|
|
Packit |
0f19cf |
here. -->
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:param name="chunker.output.method" select="'text'"/>
|
|
Packit |
0f19cf |
<xsl:param name="chunker.output.encoding" select="'UTF-8'"/>
|
|
Packit |
0f19cf |
<xsl:param name="chunker.output.indent" select="'no'"/>
|
|
Packit |
0f19cf |
<xsl:param name="chunker.output.omit-xml-declaration" select="'no'"/>
|
|
Packit |
0f19cf |
<xsl:param name="chunker.output.standalone" select="'no'"/>
|
|
Packit |
0f19cf |
<xsl:param name="chunker.output.doctype-public" select="''"/>
|
|
Packit |
0f19cf |
<xsl:param name="chunker.output.doctype-system" select="''"/>
|
|
Packit |
0f19cf |
<xsl:param name="chunker.output.media-type" select="''"/>
|
|
Packit |
0f19cf |
<xsl:param name="chunker.output.cdata-section-elements" select="''"/>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:template name="write.chunk">
|
|
Packit |
0f19cf |
<xsl:param name="filename" select="''"/>
|
|
Packit |
0f19cf |
<xsl:param name="quiet" select="$output.quietly"/>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:param name="method" select="$chunker.output.method"/>
|
|
Packit |
0f19cf |
<xsl:param name="encoding" select="$chunker.output.encoding"/>
|
|
Packit |
0f19cf |
<xsl:param name="indent" select="$chunker.output.indent"/>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
select="$chunker.output.omit-xml-declaration"/>
|
|
Packit |
0f19cf |
<xsl:param name="standalone" select="$chunker.output.standalone"/>
|
|
Packit |
0f19cf |
<xsl:param name="doctype-public" select="$chunker.output.doctype-public"/>
|
|
Packit |
0f19cf |
<xsl:param name="doctype-system" select="$chunker.output.doctype-system"/>
|
|
Packit |
0f19cf |
<xsl:param name="media-type" select="$chunker.output.media-type"/>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
select="$chunker.output.cdata-section-elements"/>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:param name="content"/>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:if test="$quiet = 0">
|
|
Packit |
0f19cf |
<xsl:message>
|
|
Packit |
0f19cf |
<xsl:text>Writing </xsl:text>
|
|
Packit |
0f19cf |
<xsl:value-of select="$filename"/>
|
|
Packit |
0f19cf |
<xsl:if test="name(.) != ''">
|
|
Packit |
0f19cf |
<xsl:text> for </xsl:text>
|
|
Packit |
0f19cf |
<xsl:value-of select="name(.)"/>
|
|
Packit |
0f19cf |
<xsl:if test="@id or @xml:id">
|
|
Packit |
0f19cf |
<xsl:text>(</xsl:text>
|
|
Packit |
0f19cf |
<xsl:value-of select="(@id|@xml:id)[1]"/>
|
|
Packit |
0f19cf |
<xsl:text>)</xsl:text>
|
|
Packit |
0f19cf |
</xsl:if>
|
|
Packit |
0f19cf |
</xsl:if>
|
|
Packit |
0f19cf |
</xsl:message>
|
|
Packit |
0f19cf |
</xsl:if>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:choose>
|
|
Packit |
0f19cf |
<xsl:when test="element-available('exsl:document')">
|
|
Packit |
0f19cf |
<xsl:choose>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:when test="$media-type != ''">
|
|
Packit |
0f19cf |
<xsl:choose>
|
|
Packit |
0f19cf |
<xsl:when test="$doctype-public != '' and $doctype-system != ''">
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
method="{$method}"
|
|
Packit |
0f19cf |
encoding="{$encoding}"
|
|
Packit |
0f19cf |
indent="{$indent}"
|
|
Packit |
0f19cf |
omit-xml-declaration="{$omit-xml-declaration}"
|
|
Packit |
0f19cf |
cdata-section-elements="{$cdata-section-elements}"
|
|
Packit |
0f19cf |
media-type="{$media-type}"
|
|
Packit |
0f19cf |
doctype-public="{$doctype-public}"
|
|
Packit |
0f19cf |
doctype-system="{$doctype-system}"
|
|
Packit |
0f19cf |
standalone="{$standalone}">
|
|
Packit |
0f19cf |
<xsl:copy-of select="$content"/>
|
|
Packit |
0f19cf |
</exsl:document>
|
|
Packit |
0f19cf |
</xsl:when>
|
|
Packit |
0f19cf |
<xsl:when test="$doctype-public != '' and $doctype-system = ''">
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
method="{$method}"
|
|
Packit |
0f19cf |
encoding="{$encoding}"
|
|
Packit |
0f19cf |
indent="{$indent}"
|
|
Packit |
0f19cf |
omit-xml-declaration="{$omit-xml-declaration}"
|
|
Packit |
0f19cf |
cdata-section-elements="{$cdata-section-elements}"
|
|
Packit |
0f19cf |
media-type="{$media-type}"
|
|
Packit |
0f19cf |
doctype-public="{$doctype-public}"
|
|
Packit |
0f19cf |
standalone="{$standalone}">
|
|
Packit |
0f19cf |
<xsl:copy-of select="$content"/>
|
|
Packit |
0f19cf |
</exsl:document>
|
|
Packit |
0f19cf |
</xsl:when>
|
|
Packit |
0f19cf |
<xsl:when test="$doctype-public = '' and $doctype-system != ''">
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
method="{$method}"
|
|
Packit |
0f19cf |
encoding="{$encoding}"
|
|
Packit |
0f19cf |
indent="{$indent}"
|
|
Packit |
0f19cf |
omit-xml-declaration="{$omit-xml-declaration}"
|
|
Packit |
0f19cf |
cdata-section-elements="{$cdata-section-elements}"
|
|
Packit |
0f19cf |
media-type="{$media-type}"
|
|
Packit |
0f19cf |
doctype-system="{$doctype-system}"
|
|
Packit |
0f19cf |
standalone="{$standalone}">
|
|
Packit |
0f19cf |
<xsl:copy-of select="$content"/>
|
|
Packit |
0f19cf |
</exsl:document>
|
|
Packit |
0f19cf |
</xsl:when>
|
|
Packit |
0f19cf |
<xsl:otherwise>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
method="{$method}"
|
|
Packit |
0f19cf |
encoding="{$encoding}"
|
|
Packit |
0f19cf |
indent="{$indent}"
|
|
Packit |
0f19cf |
omit-xml-declaration="{$omit-xml-declaration}"
|
|
Packit |
0f19cf |
cdata-section-elements="{$cdata-section-elements}"
|
|
Packit |
0f19cf |
media-type="{$media-type}"
|
|
Packit |
0f19cf |
standalone="{$standalone}">
|
|
Packit |
0f19cf |
<xsl:copy-of select="$content"/>
|
|
Packit |
0f19cf |
</exsl:document>
|
|
Packit |
0f19cf |
</xsl:otherwise>
|
|
Packit |
0f19cf |
</xsl:choose>
|
|
Packit |
0f19cf |
</xsl:when>
|
|
Packit |
0f19cf |
<xsl:otherwise>
|
|
Packit |
0f19cf |
<xsl:choose>
|
|
Packit |
0f19cf |
<xsl:when test="$doctype-public != '' and $doctype-system != ''">
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
method="{$method}"
|
|
Packit |
0f19cf |
encoding="{$encoding}"
|
|
Packit |
0f19cf |
indent="{$indent}"
|
|
Packit |
0f19cf |
omit-xml-declaration="{$omit-xml-declaration}"
|
|
Packit |
0f19cf |
cdata-section-elements="{$cdata-section-elements}"
|
|
Packit |
0f19cf |
doctype-public="{$doctype-public}"
|
|
Packit |
0f19cf |
doctype-system="{$doctype-system}"
|
|
Packit |
0f19cf |
standalone="{$standalone}">
|
|
Packit |
0f19cf |
<xsl:copy-of select="$content"/>
|
|
Packit |
0f19cf |
</exsl:document>
|
|
Packit |
0f19cf |
</xsl:when>
|
|
Packit |
0f19cf |
<xsl:when test="$doctype-public != '' and $doctype-system = ''">
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
method="{$method}"
|
|
Packit |
0f19cf |
encoding="{$encoding}"
|
|
Packit |
0f19cf |
indent="{$indent}"
|
|
Packit |
0f19cf |
omit-xml-declaration="{$omit-xml-declaration}"
|
|
Packit |
0f19cf |
cdata-section-elements="{$cdata-section-elements}"
|
|
Packit |
0f19cf |
doctype-public="{$doctype-public}"
|
|
Packit |
0f19cf |
standalone="{$standalone}">
|
|
Packit |
0f19cf |
<xsl:copy-of select="$content"/>
|
|
Packit |
0f19cf |
</exsl:document>
|
|
Packit |
0f19cf |
</xsl:when>
|
|
Packit |
0f19cf |
<xsl:when test="$doctype-public = '' and $doctype-system != ''">
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
method="{$method}"
|
|
Packit |
0f19cf |
encoding="{$encoding}"
|
|
Packit |
0f19cf |
indent="{$indent}"
|
|
Packit |
0f19cf |
omit-xml-declaration="{$omit-xml-declaration}"
|
|
Packit |
0f19cf |
cdata-section-elements="{$cdata-section-elements}"
|
|
Packit |
0f19cf |
doctype-system="{$doctype-system}"
|
|
Packit |
0f19cf |
standalone="{$standalone}">
|
|
Packit |
0f19cf |
<xsl:copy-of select="$content"/>
|
|
Packit |
0f19cf |
</exsl:document>
|
|
Packit |
0f19cf |
</xsl:when>
|
|
Packit |
0f19cf |
<xsl:otherwise>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
method="{$method}"
|
|
Packit |
0f19cf |
encoding="{$encoding}"
|
|
Packit |
0f19cf |
indent="{$indent}"
|
|
Packit |
0f19cf |
omit-xml-declaration="{$omit-xml-declaration}"
|
|
Packit |
0f19cf |
cdata-section-elements="{$cdata-section-elements}"
|
|
Packit |
0f19cf |
standalone="{$standalone}">
|
|
Packit |
0f19cf |
<xsl:copy-of select="$content"/>
|
|
Packit |
0f19cf |
</exsl:document>
|
|
Packit |
0f19cf |
</xsl:otherwise>
|
|
Packit |
0f19cf |
</xsl:choose>
|
|
Packit |
0f19cf |
</xsl:otherwise>
|
|
Packit |
0f19cf |
</xsl:choose>
|
|
Packit |
0f19cf |
</xsl:when>
|
|
Packit |
0f19cf |
<xsl:otherwise>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:message terminate="yes">
|
|
Packit |
0f19cf |
<xsl:text>Can't make chunks with </xsl:text>
|
|
Packit |
0f19cf |
<xsl:value-of select="system-property('xsl:vendor')"/>
|
|
Packit |
0f19cf |
<xsl:text>'s processor.</xsl:text>
|
|
Packit |
0f19cf |
</xsl:message>
|
|
Packit |
0f19cf |
</xsl:otherwise>
|
|
Packit |
0f19cf |
</xsl:choose>
|
|
Packit |
0f19cf |
</xsl:template>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:template name="write.text.chunk">
|
|
Packit |
0f19cf |
<xsl:param name="filename" select="''"/>
|
|
Packit |
0f19cf |
<xsl:param name="quiet" select="0"/>
|
|
Packit |
0f19cf |
<xsl:param name="method" select="'text'"/>
|
|
Packit |
0f19cf |
<xsl:param name="encoding" select="$chunker.output.encoding"/>
|
|
Packit |
0f19cf |
<xsl:param name="media-type" select="$chunker.output.media-type"/>
|
|
Packit |
0f19cf |
<xsl:param name="content"/>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:call-template name="write.chunk">
|
|
Packit |
0f19cf |
<xsl:with-param name="filename" select="$filename"/>
|
|
Packit |
0f19cf |
<xsl:with-param name="quiet" select="$quiet"/>
|
|
Packit |
0f19cf |
<xsl:with-param name="method" select="$method"/>
|
|
Packit |
0f19cf |
<xsl:with-param name="encoding" select="$encoding"/>
|
|
Packit |
0f19cf |
<xsl:with-param name="indent" select="'no'"/>
|
|
Packit |
0f19cf |
<xsl:with-param name="omit-xml-declaration" select="'no'"/>
|
|
Packit |
0f19cf |
<xsl:with-param name="standalone" select="'no'"/>
|
|
Packit |
0f19cf |
<xsl:with-param name="doctype-public"/>
|
|
Packit |
0f19cf |
<xsl:with-param name="doctype-system"/>
|
|
Packit |
0f19cf |
<xsl:with-param name="media-type" select="$media-type"/>
|
|
Packit |
0f19cf |
<xsl:with-param name="cdata-section-elements"/>
|
|
Packit |
0f19cf |
<xsl:with-param name="content" select="$content"/>
|
|
Packit |
0f19cf |
</xsl:call-template>
|
|
Packit |
0f19cf |
</xsl:template>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
</xsl:stylesheet>
|