<?xml version="1.0"?>
<!--$Id: repeat.xhtml,v 1.24 2005/10/17 10:55:57 honkkis Exp $-->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xfm="http://www.w3.org/2002/xforms" xmlns:xlink="http://www.w3.org/1999/xlink " xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:my="http://commerce.example.com/payment" xmlns:ev="http://www.w3.org/2001/xml-events" xml:lang="en">
	<head>
		<!-- <link rel="stylesheet" type="text/css" href="bookmarks.css" />-->
		<link rel="stylesheet" type="text/css" href="../xforms/xformsdemo.css" />
		<style type="text/css">
			body { font-style: normal; font-weight: 500; background-color: white; color: black;}
			output::value {color:black;width:200pt}
			input::value {width:150pt;}
			input.section::value {width:500pt;font-size:25px;}
			p.section {border-style:solid;background-color:#eeeeee;border-width:2px;}
            repeat#repeatSections repeat::repeat-index {background-color:#ffffff;color:#000088;}
            repeat::repeat-index input::value {background-color:yellow;}
            repeat::repeat-index {background-color:red;}
            
			</style>
		<title>Editing Hierarchical Bookmarks In An XML Browser</title>
		<xfm:model id="bookmarks">
			<!--The bookmarks instance tree is shown inline for
      the sake of this example.
XML browser XSmiles would use
 <xfm:instance src="bookmarks.xml"/>.
-->
			<xfm:instance xmlns="">
				<bookmarks>
					<section name="main">
						<bookmark href="http://www.xsmiles.org/demo/demos.xml" name="Main page" />
					</section>
					<section name="demos">
						<bookmark href="http://www.xsmiles.org/demo/fo/images.fo" name="images" />
						<bookmark href="http://www.xsmiles.org/demo/fo/xforms-ecma.xml" name="xforms-ecma" />
						<bookmark href="http://www.xsmiles.org/demo/fo/sip.fo" name="sip" />
					</section>
					<section name="misc">
						<bookmark href="sip:ppeisa@lactose.tml.hut.fi" name="call: ppeisa" />
						<bookmark href="http://www.xsmiles.org/demo/fo/images.fo" name="Images" />
						<bookmark href="http://www.xsmiles.org/demo/links.xml" name="Links" />
					</section>
					<section name="XForms">
						<bookmark href="file:/C:/source/xsmiles/demo/xforms/xforms-xmlevents.xml" name="XML events" />
						<bookmark href="file:/C:/source/xsmiles/demo/xforms/model3.xml" name="model3" />
						<bookmark href="file:/C:/source/xsmiles/demo/xforms/repeat.fo" name="repeat + constraints" />
					</section>
				</bookmarks>
			</xfm:instance>
			<xfm:submission id="submit1" method2="postxml" target2="http://www.examples.com/" localfile="temp.xml" />
		</xfm:model>
	</head>
	<body>
		<p>Nested repeat example from the Jan 2002 XForms Last Call Spec</p>
		<xfm:repeat nodeset="/bookmarks/section" id="repeatSections">
		<p class="section">
			<p>
			<xfm:input ref="@name" class="section">
				<xfm:label class="section">Section</xfm:label>
			</xfm:input>
			</p>
			<!-- BOOKMARK REPEAT START -->
			<xfm:repeat nodeset="bookmark" id="repeatBookmarks">
				<p>
					<xfm:input ref="@name">
						<xfm:label>Name</xfm:label>
					</xfm:input>
					<xfm:input ref="@href" >
						<xfm:label>Link</xfm:label>
					</xfm:input>
				</p>
			</xfm:repeat>
</p>
		</xfm:repeat>
		<!-- INSERT BOOKMARK BUTTON -->
		<p>
			<xfm:trigger id="insertbutton">
				<xfm:label>Insert bookmark</xfm:label>
				<xfm:insert nodeset="/bookmarks/section[index('repeatSections')]/bookmark" at="index('repeatBookmarks')" position="before" ev:event="DOMActivate" />
			</xfm:trigger>
			<xfm:trigger id="insertbuttonafter">
				<xfm:label>Insert bookmark</xfm:label>
				<xfm:insert nodeset="/bookmarks/section[index('repeatSections')]/bookmark" at="index('repeatBookmarks')" position="after" ev:event="DOMActivate" />
			</xfm:trigger>
			<xfm:trigger id="delete">
				<xfm:label>Delete bookmark</xfm:label>
				<xfm:delete nodeset="/bookmarks/section[index('repeatSections')]/bookmark" at="index('repeatBookmarks')" ev:event="DOMActivate" />
			</xfm:trigger>
			
		</p>
		<p>
			<xfm:trigger id="insertsectionbutton">
				<xfm:label>Insert section</xfm:label>
				<xfm:insert ref="/bookmarks/section" at="index('repeatSections')" position="after" ev:event="DOMActivate" />
			</xfm:trigger>
			<xfm:trigger id="deletesectionbutton">
				<xfm:label>Delete section</xfm:label>
				<xfm:delete ref="/bookmarks/section" at="index('repeatSections')" ev:event="DOMActivate" />
			</xfm:trigger>
			</p>
		<p>
			<!-- SUBMIT BUTTON -->
			<xfm:submit name="Submit" submission="submit1">
				<xfm:hint>Click to submit</xfm:hint>
				<xfm:label>Save</xfm:label>
			</xfm:submit>
			<!-- RESET BUTTON -->
			<xfm:trigger>
				<xfm:hint>Click to reset</xfm:hint>
				<xfm:label>Reset</xfm:label>
				<xfm:reset model="bookmarks" ev:event="DOMActivate"/>
			</xfm:trigger>
		</p>
	</body>
</html>
