J
J Bondo
Hi again,
I'm having some issues with my stylesheet that converts from DocBook
XML to plist XML.
I need to do some simple HTML translation. For example, I'd like this
input:
<para>This is a <glossterm>term</glossterm>, and this is not.</para>
to become:
<p>This is a <dfn>term</dfn>, and this is not.</p>
With my stylesheet, however, it becomes:
<p>This is a
<dfn>term</dfn>
, and this is not.
The problem is the newline after the </dfn>. When rendering the HTML,
it causes whitespace between the term and the comma.
My style sheet looks like this:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:db="http://docbook.org/ns/docbook"
exclude-result-prefixes="db"
version="1.0">
<xslutput encoding="UTF-8" indent="yes" method="xml"
doctype-public="-//Apple//DTD PLIST 1.0//EN"
doctype-system="http://www.apple.com/DTDs/PropertyList-1.0.dtd"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<plist version="1.0">
<dict>
<xsl:apply-templates select="db:book/db:info"/>
<key>Chapters</key>
<array>
<xsl:apply-templates select="db:book/db:chapter"/>
</array>
</dict>
</plist>
</xsl:template>
....
<xsl:template match="dbara">
<p><xsl:apply-templates/></p>
</xsl:template>
....
<xsl:template match="db:glossterm">
<dfn><xsl:value-of select="."/></dfn>
</xsl:template>
....
<xsl:template match="db:*">
</xsl:template>
</xsl:stylesheet>
Thank you for your time,
Joachim
I'm having some issues with my stylesheet that converts from DocBook
XML to plist XML.
I need to do some simple HTML translation. For example, I'd like this
input:
<para>This is a <glossterm>term</glossterm>, and this is not.</para>
to become:
<p>This is a <dfn>term</dfn>, and this is not.</p>
With my stylesheet, however, it becomes:
<p>This is a
<dfn>term</dfn>
, and this is not.
The problem is the newline after the </dfn>. When rendering the HTML,
it causes whitespace between the term and the comma.
My style sheet looks like this:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:db="http://docbook.org/ns/docbook"
exclude-result-prefixes="db"
version="1.0">
<xslutput encoding="UTF-8" indent="yes" method="xml"
doctype-public="-//Apple//DTD PLIST 1.0//EN"
doctype-system="http://www.apple.com/DTDs/PropertyList-1.0.dtd"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<plist version="1.0">
<dict>
<xsl:apply-templates select="db:book/db:info"/>
<key>Chapters</key>
<array>
<xsl:apply-templates select="db:book/db:chapter"/>
</array>
</dict>
</plist>
</xsl:template>
....
<xsl:template match="dbara">
<p><xsl:apply-templates/></p>
</xsl:template>
....
<xsl:template match="db:glossterm">
<dfn><xsl:value-of select="."/></dfn>
</xsl:template>
....
<xsl:template match="db:*">
</xsl:template>
</xsl:stylesheet>
Thank you for your time,
Joachim