inserting instance elements with a trigger

Hi,

How can I insert an instance element, which has some child elements as well, with the help of a trigger? I just know the examples of X-Smiles where a repeat is used. The problem is that I don't want my UI to change, when I insert the new instance structure. 
I only want my ref- attributes in the UI to match the latest inserted elements. 

Have in the following instance:

<xforms:instance>
	<topicMap xmlns="http://www.topicmaps.org/xtm/1.0/" xmlns:xlink="http://www.w3.org/1999/xlink">
		<topic id="">
			<instanceOf>
				<topicRef xlink:href=""/>
			</instanceOf>
			<baseName>
				<baseNameString></baseNameString>
			</baseName>
			<occurrence>
				<instanceOf>
					<topicRef xlink:href=""/>
				</instanceOf>
				<resourceRef xlink:href=""/>
			</occurrence>
			<occurrence>
				<instanceOf>
			    		<topicRef xlink:href="#"/>
				</instanceOf>
				<resourceData></resourceData>
			</occurrence>
		</topic>
		<association>
			<instanceOf>
				<topicRef xlink:href=""/>
			</instanceOf>
				<member>
					<roleSpec>
						<topicRef xlink:href=""/>
					</roleSpec>
					<topicRef xlink:href=""/>
				</member>
				<member>
					<roleSpec>
						<topicRef xlink:href=""/>
					</roleSpec>
					<topicRef xlink:href=""/>
				</member>
		</association>
	</topicMap>
</xforms:instance>

I want the topic element to be duplicated (or a new topic element to be inserted) when I use a trigger.
I thought about something like 

	<xforms:trigger id="insertbutton">
		<xforms:label>Insert</xforms:label>
		<xforms:action ev:event="click">
			<xforms:insert ref="/topicMap/topic" at="position()=last()" position="after"/>
		</xforms:action>
	</xforms:trigger>
 
But it didn't work in X-Smiles.
Do you have any solutions, please?

wbr,
Roman 

Received on Thursday, 5 December 2002 05:34:06 UTC