recursive interleaving -- is it possible

Hi ,

I am new to the list, and I have a rather complex assignment to complete
in XML. Any help the good folks out there can give me will be
appreciated.

I need to compose an XML schema which will enable the following elements
to be considered valid in instance documents:

	a)	for starters, a standard definition of a sequence of
“primitive” elements which in instance documents will look like

		<primitive name=”foo”>
			whatever
		</primitive>

		with foo a unique ID name. This I can handle.

	b)	Now a recursive definition, which will permit all of the
following elements to be valid in instance documents:

		<recursiveFunction name=”bar”>
			<functionOf>
				<primitive name=”foo”/>
			</functionOf>
		</recursiveFunction>

		<recursiveFunction name=”bar”>
			<functionOf>
				<functionOf>
					<primitive name=”foo”/>
				</functionOf>
			</functionOf>
		</recursiveFunction>

		<recursiveFunction name=”bar”>
			<functionOf>
				<functionOf>
					…
					<functionOf>
						<primitive name=”foo”/>
					</functionOf>
				…
				</functionOf>
			</functionOf>
		</recursiveFunction>

		to any depth, with foo a reference to an already defined
primitive

	c)	Even further, enabling a recursive definition with
“interleaved” tags, such as 

		<recursiveFunction name=”bar”>
			<functionOf>
				<injectionOf>
					<primitive name=”foo”/>
				</injectionOf>
			</functionOf>
		</recursiveFunction>

		<recursiveFunction name=”bar”>
			<functionOf>
				<injectionOf>
					…
					<functionOf>
						<primitive name=”foo”/>
					</functionOf>
				…
				</injectionOf>
			</functionOf>
		</recursiveFunction>

		to any depth and sequence of interleaving

	d)	Further, to enable the identifying names of the
recursive elements to be generated automatically by the structure, so
that 

		<recursiveFunction >
			<functionOf>
				<injectionOf>
					<primitive name=”foo”/>
				</injectionOf>
			</functionOf>
		</recursiveFunction>

		is automatically assigned an ID name f [ g [ foo] ] ], 

		<recursiveFunction >
			<injectionOf>
				<functionOf>
					<injectionOf>
						<primitive name=”foo”/>
					</injectionOf>
				</functionOf>
			</injectionOf>
		</recursiveFunction>

		is automatically assigned the name g[ f[ g[ foo] ] ]

		and so forth.


	e)	Finally, to enable the element declaration

		<recursiveFunction >
			<functionOf>
				<recursiveFunction name=” f [ g [ foo] ]
]”/>
			</functionOf>
	  	</recursiveFunction>

		and that should be considered equivalent to

		<recursiveFunction >
			<functionOf>
				<functionOf>
					<injectionOf>
						<primitive name=”foo”/>
					</injectionOf>
				</functionOf>
			</functionOf>
	  	</recursiveFunction>


	I think most readers should gather what I mean from all these
examples. As I said, any assistance here would be appreciated.


	Regards,

	Ziv

Received on Thursday, 15 March 2001 15:42:57 UTC