<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp   "&#160;">
<!ENTITY lsaquo   "&#8249;">
<!ENTITY rsaquo   "&#8250;">
<!ENTITY laquo  "&#171;">
<!ENTITY raquo  "&#187;">
<!ENTITY copy   "&#169;">
]>
<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:ouc="http://omniupdate.com/XSL/Variables"
				exclude-result-prefixes="xs ou ouc"
				expand-text="yes">

	<xsl:import href="/var/staging/OMNI-INF/stylesheets/implementation/v1/template-matches.xsl"/> <!-- global template matches -->
	<xsl:import href="/var/staging/OMNI-INF/stylesheets/implementation/v1/variables.xsl"/> <!-- global variables -->
	<xsl:import href="/var/staging/OMNI-INF/stylesheets/implementation/v1/functions.xsl"/> <!-- global functions -->
	<xsl:import href="../../_shared/ouvariables.xsl"/> <!-- customer variables -->
	<xsl:import href="functions.xsl"/> <!-- DMC functions -->
	<xsl:include href="xml-beautify.xsl" />

<!-- 	71502 Start -->
	<xsl:function name="ou:get-item">
		<xsl:param name="document" />
		<item>
			<xsl:attribute name="href" select="concat($dirname, replace($ou:filename, 'xml', $extension))" />
			<xsl:attribute name="dsn" select="ou:pcf-param('dsn')" />
			<xsl:for-each select="$document/item/ouc:div">
				<xsl:choose>
					<xsl:when test="@label = 'pubDate' and ou:multiedit-field('pubDate') = ''">
						<xsl:element name="{translate(./@label, ' ', '_')}">09/22/2021</xsl:element>
					</xsl:when>
					<xsl:otherwise>
						<xsl:element name="{translate(./@label, ' ', '_')}">
							<xsl:apply-templates select="node()[not(self::ouc:multiedit)]" />
						</xsl:element>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:for-each>
			<xsl:if test="$tags != ''">		
				<tags>		
					<xsl:for-each select="tokenize($tags, ',')">
						<xsl:sort select="." />
						<tag>{.}</tag>		
					</xsl:for-each>		
				</tags>		
			</xsl:if>
			<xsl:call-template name="dmc-item-data" />
		</item>
	</xsl:function>
<!-- 	71502 End -->

	<xsl:template match="/document">
		<xsl:copy-of select="ou:get-item(.)" />
	</xsl:template>

</xsl:stylesheet>
