This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
XSL HTML stylesheets: combining keywords into singleMETA tag
- To: docbook-apps <docbook-apps at lists dot oasis-open dot org>
- Subject: DOCBOOK-APPS: XSL HTML stylesheets: combining keywords into singleMETA tag
- From: pilgrim_mark at yahoo dot com
- Date: Wed, 03 Jan 2001 06:18:31 -0800 (PST)
Norm,
I hacked my stylesheet's head.content template to
output my <keywordset> keywords, but they show up as
separate META tags. All sites I have seen (and docs I
have read on search engine HOWTO sites) suggest using
a single META tag, name="keywords" (note plural),
content="<comma-separated list of keywords>".
Current output:
<META name="keyword" content="Python">
<META name="keyword" content="tutorial">
<META name="keyword" content="free">
Proposed output:
<META name="keywords" content="Python, tutorial,
free">
Here is sample XSL to do this:
<xsl:template match="keywordset" mode="html.header">
<meta name="keywords">
<xsl:attribute name="content">
<xsl:apply-templates select="keyword"
mode="html.header"/>
</xsl:attribute>
</meta>
</xsl:template>
<xsl:template match="keyword" mode="html.header">
<xsl:apply-templates/><xsl:text>, </xsl:text>
</xsl:template>
<xsl:template match="keyword[position()=last()]"
mode="html.header">
<xsl:apply-templates/>
</xsl:template>
Of course this relies on solving the vexing problem
(mentioned in a previous message) of head.content not
outputting keywords at all, for which I do not have a
good solution.
-M
__________________________________________________
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/