Extensions to ZeeRex Records

28th March 2002

Do you need an extension?

What should you do if you want your ZeeRex records to carry additional information that's not in the DTD?

How to make an extension

In order to ensure that extensions do not confuse clients that don't understand them, we require that they be placed in an XML namespace. You are at liberty to use any namespace that is owned by you.

You may add any new attribute or any new element within your namespace; the only restriction is that you may not place standard elements of the ZeeRex record within your extension elements.

For example, this is legal:

	
	<explain xmlns:foo='http://foo.bar.com/whatever'>
	  <serverInfo>
	    <host>gondolin.hist.liv.ac.uk</host>
	    <port>210</port>
	    <database>mailarchive</database>
	    <foo:yearsInService>5</foo:yearsInService>
	  </serverInfo>
	</explain>	

[download]

But the following example is not: its intention is to use an ``extended'' version of the <serverInfo> element from the foo namespace, but that doesn't work because it prevents clients that don't know about http://foo.bar.com/whatever from seeing the host, port and database that are nested inside it:

	
	<explain xmlns:foo='http://foo.bar.com/whatever'>
	  <foo:serverInfo>
	    <host>gondolin.hist.liv.ac.uk</host>
	    <port>210</port>
	    <database>mailarchive</database>
	    <yearsInService>5</yearsInService>
	  </foo:serverInfo>
	</explain>	

[download]

The motivating idea here is: a client which does not recognise a namespace used in an extension must be able to completely ignore every element in that namespace without losing any ZeeRex data.

Feedback to <mike@indexdata.com> is welcome!