That's very odd. There are no such limits that I know of in the stylesheets or XSL.
Your template is just generating a string in $indexterm-unique and putting that string
in an attribute of a meta element. Attribute values can be any length.
Have you tried a different XSLT processor?
Bob Stayton
Sagehill Enterprises
[email protected]
----- Original Message -----
From: "Tim Arnold" <[email protected]>
To: "DocBook Apps" <[email protected]>
Sent: Tuesday, May 29, 2012 11:29 AM
Subject: [docbook-apps] user.head.content character limit?
hi,
I am inserting all the primary index terms for a page into the html
metadata by using the user.head.content template. For one page that is
particularly dense with technical terms I'm seeing my metadata get
truncated with the contents overflowing into the html body. That is
the keywords= metadata contains 2,527 characters and the rest of the
metadata (637 characters) appears inside the <body> element
I have two types of index terms; when I select either one of them with
@type=, the html is rendered correctly. With the code below, where I
do not specify a type value, I get the keywords split between the
<head> and the <body> elements. I'm using the xsl-1.76.1 html
stylesheets (namespaced) with DocBook 5.
specify type 1: the result is 736 characters long;
specify type 2: result is 2,415 characters
no type specified: 3,164 characters and bad rendering.
Can it be that there is a character limit for metadata in the stylesheets?
thanks,
--Tim Arnold
simplified template code:
<xsl:template name="user.head.content">
<xsl:call-template name="keywordset" />
</xsl:template>
<xsl:template name="keywordset">
<xsl:variable name="section_level">
<xsl:number value="count(ancestor-or-self::d:section)" />
</xsl:variable>
<xsl:variable name="indexterms">
<xsl:choose>
<xsl:when test="$section_level < $chunk.section.depth">
<xsl:copy-of
select="./d:indexterm[@type]/d:primary|./*[not(self::d:section)]//d:indexterm[@type]/d:primary"
/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select=".//d:indexterm[@type]/d:primary" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="indexterms-unique">
<xsl:for-each select="exsl:node-set($indexterms)/*[not(. =
preceding-sibling::*)]">
<xsl:value-of select="normalize-space(.)" />
<xsl:if test="not(position() = last())">
,
</xsl:if>
</xsl:for-each>
</xsl:variable>
<meta name="keywords">
<xsl:attribute name="content">
<xsl:value-of select="$indexterms-unique" />
</xsl:attribute>
</meta>
</xsl:if>
</xsl:template>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]