<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp   "&#160;">
]>
<xsl:stylesheet version="3.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:ou="http://omniupdate.com/XSL/Variables"
	xmlns:fn="http://omniupdate.com/XSL/Functions"
	xmlns:ouc="http://omniupdate.com/XSL/Variables"
	exclude-result-prefixes="xsl xs ou fn ouc">

	<xsl:param name="ou:search-category" />
	<xsl:param name="ou:search-author" />
	<xsl:param name="ou:search-tag" />

	<xsl:variable name="search-category">
		<xsl:for-each select="tokenize($ou:search-category, ',')">
			search-category="<xsl:value-of select="normalize-space(.)"/>"
		</xsl:for-each>
	</xsl:variable>

	<xsl:variable name="search-author">
		<xsl:for-each select="tokenize($ou:search-author, ',')">
			search-author="<xsl:value-of select="normalize-space(.)"/>"
		</xsl:for-each>

		<xsl:for-each select="tokenize(/document/ouc:properties/meta[@name = 'Author']/@content, ',')">
			search-author="<xsl:value-of select="normalize-space(.)"/>"
		</xsl:for-each>

		<xsl:for-each select="tokenize(/document/post-info/ouc:div[@label = 'post-author'], ',')">
			search-author="<xsl:value-of select="normalize-space(.)"/>"
		</xsl:for-each>
	</xsl:variable>

	<xsl:variable name="search-tag">
		<xsl:for-each select="tokenize($ou:search-tag, ',')">
			search-tag="<xsl:value-of select="normalize-space(.)"/>"
		</xsl:for-each>

		<xsl:for-each select="tokenize(ou:pcfparam('search-tag'), ',')">
			search-tag="<xsl:value-of select="normalize-space(.)"/>"
		</xsl:for-each>
	</xsl:variable>

	<xsl:template name="parametric-search">
		<xsl:comment>
			OU Search - Parametric Fields:
			<xsl:value-of select="$search-category" />
			<xsl:value-of select="$search-author" />
			<xsl:value-of select="$search-tag" />
		</xsl:comment>
	</xsl:template>

</xsl:stylesheet>
