This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

XSL HTML stylesheets: combining keywords into singleMETA tag


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/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]