cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Bentley" <bent...@boogaloos.de>
Subject Recursion in CForms
Date Tue, 25 Jan 2005 20:02:35 GMT


Well, I have been working with the brilliant cforms for a while, but 
now I am trying to do someting that is very natural in XML, but seems 
to be a serios problem in cforms, and that is quite simply a tree 
structure

Trying to something like this is really uncomfortable.

<tree>
	<treeNode>
		<treeNodeName>I am a node</treeNodeName>
		<treeNodeChildren>
			<treeNode>
				<treeNodeName>I am a node</treeNodeName>
				<treeNodeChildren>
					<treeNode>
						<treeNodeName>I am a 
node</treeNodeName>
						<treeNodeChildren/>
					</treeNode>
				</treeNodeChildren>
			</treeNode>
		</treeNodeChildren>
	</treeNode>
	<treeNode>
		<treeNodeName>I am a node</treeNodeName>
		<treeNodeChildren/>
	</treeNode>
</tree>

The natural thing would to define a definition like this:

<fd:form>
	<fd:widgets>
		<fd:new id="treeNode"/>
		<fd:class id="treeNode">
			<fd:widgets>
				<fd:struct id="treeNodeChildren">
					<fd:widgets>
						<fd:new id="treeNode"/>
					</fd:widgets>
				</fd:struct>
				<fd:field id="treeNodeName">
					<fd:datatype base="string"/>
					<fd:label>Tree Node 
Name</fd:label>
				</fd:field>
			</fd:widgets>
		</fd:class>
	</fd:widgets>
</fd:form>

However directing a fd:new "treeNode" within the fd:class "treeNode",
creates a recursion error. I can naturally understand that the developer
wanted to hinder an tree structure being huge in memory for no reason.

Does any one know how to do this using cforms in a reasonable way.

Thank You
Chris Bentley

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message