Comments on XInclude

In a system that we are developing for the entertainment industry, we
currently use a scheme similar to XInclude to modularise our XML documents.

The scheme we use looks like this:

foo.xml:

<foo>
	<import url="bar.xml"/>
</foo>

bar.xml:

<bar name="mybar">
</bar>

It works exactly as you described. The XML is included during parseing and
appears to the XML reader as if the document was in a single large piece.

There are two additions to this that help us:

	1) You can changed an attribute at the root by overriding in the
import.

		<foo>
			<import url="bar.xml" name="bar1"/>
			<import url="bar.xml" name="bar2"/>
		</foo>

		Now each of the bars are uniquely named for later
processing.

	2) You can substitue variables like the C preprocessor.

		<foo>
			<import url="bar.xml" name="bar1">
				<param name="p1" value="123"/>
			</import>
		</foo>

		bar.xml:

		<bar name="mybar">
			<sometag>$(p1)</sometag>
		</bar>

		Afterwards you get:

		<foo>
			<bar name="mybar">
				<sometag>123</sometag>
			</bar>
		</foo>

Both of these techniques have proved invaluable in our development, and for
adoption of XInclude (which I would love to do) woudl need facililties like
this.

I hope this is not all FAQ. If it is, just let me know.

Paul.

-----------------------------------------------------
Paul Hamilton
Technical Manager - Software
Bailey Bailey & Bailey Pty Ltd
http://www.bbb.com.au
Ph:  +61 1300 722 213
Fax: +61 1300 722 223
paul@bbb.com.au

The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from any
computer. Please note that contents of all BBB emails may be randomly
monitored to prevent the unauthorised sending or receiving of offensive
material.
-----------------------------------------------------

Received on Tuesday, 23 May 2000 01:14:07 UTC