<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"  exclude-result-prefixes="cmd"
xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" 
xmlns:cmd="http://www.novell.com/nxsl/java/com.novell.nds.dirxml.driver.XdsCommandProcessor">

	<!--These are the two parameters that are needed for Channel Write-Back -->
	<xsl:param name="srcCommandProcessor"/>
	<xsl:param name="destCommandProcessor"/>

	<!-- This is the identity template that copies otherwise unmatched items to the result -->
	<xsl:template match="node()|@*">
		<xsl:copy>
			<xsl:apply-templates select="@*|node()"/>
		</xsl:copy>
	</xsl:template>

	<xsl:template match="modify[@class-name='User']/modify-attr[@attr-name='Description']">
		<!-- First we generate the XDS fragment with the password Change -->
		<xsl:variable name="cmd-change-pw">
			<modify-password class-name="User" dest-dn="{../@dest-dn}">
				<password><xsl:value-of select="add-value/value"/></password>
			</modify-password>
		</xsl:variable>

		<!-- Now we send the XDS fragment generated above to the dest Directory  -->
		<xsl:variable name="results" select="cmd:execute($destCommandProcessor, $cmd-change-pw)"/> 
	</xsl:template>	
	
	<xsl:template match="add[@class-name='User']/add-attr[@attr-name='Description']">
		<password><xsl:value-of select="value"/></password>
	</xsl:template>
</xsl:stylesheet>

