Hi Sam,
I don't think using normalize-space() would be satisfactory, because that
function returns text only, and would remove the html markup that makes it a
cross reference. Applying normalize-space to the xref would return
nothing, because an xref element is empty.
You don't want to mess with the markup, only with the text nodes of cross
reference targets that contain carriage returns. There is no specific mode
for that, but the no.anchor.mode comes close. It is used when generating
cross references because it prevents nested links (i.e., no link anchors
inside the link text). Since that is a mode, you can use it to match only
the text nodes in titles as follows to map any line feeds in the title to
spaces:
<xsl:template match="title/text()" mode="no.anchor.mode">
<xsl:value-of select="translate(., '
', ' ')"/>
</xsl:template>
This seems to work, and I haven't noticed any side effects, but be sure to
test it.
Bob Stayton
Sagehill Enterprises
bobs@sagehill.net