<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>

<xsl:template match="/">

<html>
<head>
	<title>Address book</title>

<script language="JavaScript">
function popCalendar(xml_field_name)
{
	var strProperties = "dialogHeight: 300px;"; 
	strProperties += " dialogWidth: 350px;"; 
	strProperties += " center: Yes; help: No; resizable: No; status: No; scroll: No;"

	window.showModalDialog('calendar.htm', xml_field_name, strProperties);
}
</script>

<script language="JavaScript">
function popTime(xml_field_name)
{
	var strProperties = "dialogHeight: 300px;"; 
	strProperties += " dialogWidth: 350px;"; 
	strProperties += " center: Yes; help: No; resizable: No; status: No; scroll: No;"

	window.showModalDialog('time.htm', xml_field_name, strProperties);
}
</script>

</head>

<body style="background:silver;">

<form action="3.xml" method="post" name="form">

<xsl:for-each select="//root/person">
	<p/><input>
		<xsl:attribute name="name">name</xsl:attribute>
		<xsl:attribute name="value">John</xsl:attribute>
		</input>	
	<p/><input>
		<xsl:attribute name="name">surname</xsl:attribute>
		<xsl:attribute name="value">Smith</xsl:attribute>
		</input>	
	<p/><input>
		<xsl:attribute name="name">phone</xsl:attribute>
		<xsl:attribute name="value">111-2233</xsl:attribute>
		</input>	
	<p/><input>
		<xsl:attribute name="name">birth_date</xsl:attribute>
		<xsl:attribute name="value"><xsl:value-of select="birth_date"/></xsl:attribute>
		<xsl:attribute name="maxlength">10</xsl:attribute>
		<xsl:attribute name="size">8</xsl:attribute>
		</input>	
		
		<a onClick="popCalendar(document.forms.form.birth_date)">
			<xsl:attribute name="href">#</xsl:attribute>
			...
		</a>

		
	<p/><input>
		<xsl:attribute name="name">birth_time</xsl:attribute>
		<xsl:attribute name="value"><xsl:value-of select="birth_time"/></xsl:attribute>
		<xsl:attribute name="maxlength">8</xsl:attribute>
		<xsl:attribute name="size">6</xsl:attribute>
		</input>	
	
		<a onClick="popTime(document.forms.form.birth_time)">
			<xsl:attribute name="href">#</xsl:attribute>
			...
		</a>

</xsl:for-each>

<p/><input>
		<xsl:attribute name="type">submit</xsl:attribute>
		<xsl:attribute name="name">OK</xsl:attribute>
		<xsl:attribute name="value">Submit</xsl:attribute>
	</input>
</form>			
<form method="get" action="3.xml">
	<input>
		<xsl:attribute name="type">submit</xsl:attribute>
		<xsl:attribute name="name">cancel</xsl:attribute>
		<xsl:attribute name="value">Cancel</xsl:attribute>
	</input>	
</form>

</body>
</html>
</xsl:template>
</xsl:stylesheet>
