<?xml version='1.0'?>
<xsl:stylesheet
		version="1.0"
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
       
<!-- Set Initial Password to Surname, by Kelvin Dam -->
<!-- Apply as CommandXForm on Subscriber -->
<xsl:strip-space elements="*"/>
<xsl:preserve-space elements="association add-association remove-association value component password check-password"/>
<xsl:output indent="yes" method="xml"/>

<!-- Here I match on User class creation and set the password value to the same as Surname -->
	
<xsl:template match="add[@class-name='User']">
<xsl:message>Cmd Event on Subscriber: Password set to Surname </xsl:message>	
	<xsl:copy>
			<xsl:apply-templates select="@*|node()"/>
			<password>
				<xsl:value-of select="add-attr[@attr-name='Surname']/value/text()"/>
			</password>
	</xsl:copy>
</xsl:template>

<xsl:template match="node()|@*">
	<xsl:copy>
		<xsl:apply-templates select="@*|node()"/>
	</xsl:copy>
</xsl:template>
</xsl:stylesheet>