I like to use entity references for repeated strings and reusable portions of xpaths, especially for concatenating xpath statements together to form a longer path.
For example
<!DOCTYPE xsl:stylesheet [
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
<!ENTITY rss "http://purl.org/rss/1.0/" >
<!ENTITY content "http://purl.org/rss/1.0/modules/content/">
<!ENTITY xsl "http://www.w3.org/1999/XSL/Transform" >
<!ENTITY html "http://www.w3.org/1999/xhtml">
<!ENTITY linkpredbase "html:link[@rel='alternate'][@type='application/rss+xml']">
<!ENTITY linkpred "&linkpredbase;[contains(@href,':')]" >
<!ENTITY rellinkpred "&linkpredbase;[@href][not(contains(@href,':'))]">
<!ENTITY relrsslink "html:head[&linkpredbase;]">
<!ENTITY rsslink "html:head[&linkpred;]">
<!ENTITY baseuri "html:base/@href">
<!ENTITY badChannelLocation "/html:html[descendant::rss:channel[preceding::rss:*]]">
<!ENTITY content-meta "/html:html/html:head/html:meta[@name='copy-descriptions-to-content']">
<!ENTITY linkWithAnchorStart "rss:link[descendant::html:a/@href" >
<!ENTITY linkWithAnchor "&linkWithAnchorStart;]">
<!ENTITY dc-meta "html:meta[starts-with(@name,'DC')]">
<!ENTITY dc "http://purl.org/dc/elements/1.1/">
]>
....
<xsl:when
test="&content-meta;">
<xsl:value-of select="&content-meta;/@content" />
</xsl:when>
|