The xcw Namespace

Introduction

This document proposes a layout of the 'xcw namespace'. This namespace contains an XML definition for objects and their interfaces. The goal of this document is to define an extendable and exchangable format that allows to describe arbitrary objects (though Open Source Software (OSS) related), maintained by authors through-out the world, and how they might interact.

The main purpose of this format is to allow for a formal definition of how different open source projects and/or objects are interdependent and might interact with each other.

For example, an author of an open source project (see Open Source Initiative), as might be hosted by one of the several SourceForge sites or listed on FreshMeat, might have written a C++ library and put the complete description of their library in xcw namespace. This would include the name of the library and where to download as well as documentation of how to use it. However, it can also contain a machine readable description of what to add to several files of other projects in order to use it. For example, things to add to a configure.ac file and Makefile.am file (see automake); or instructions for adding it to an Eclipse project. Subsequentently an Eclipse extension would be written that reads this XML file and adds the support for you. Once this has been done, other C++/java library vendors can add the same descriptions to the xcw namespace of their project; allowing users of their library to seemless add support for their library to Eclipse and/or automake.

XML files

Every definition is exported in the form of XML files. A file that defines an object in the xcw namespace therefore has the form:

<?xml version="1.0"?> <xcw:root xmlns:xcw="http://xcw.alinoe.com/"> [content] </xcw:root>

Where [content] can be anything. Some of which is defined below. The xcw:root is basically ignored, it can be used to group multiple projects into one file however. If you only define a single project. It could also be xcw:project, or when it's a file that is included in another definition, it could for example be xcw:author, when that is the root element.

Definition Version

A xcw:definition_version defines the version of the parent element's definition.

For example, a definition of parent could be given as follows:

<parent> <xcw:definition_version> <xcw:current>2.20041109.2</xcw:current> <xcw:interface>2.20020718</xcw:interface> <xcw:url>http://thissite.org/parent.xml/</xcw:url> </xcw:definition_version> [content] </parent>

The value given by xcw:current defines the current version of the definition of parent in that particular file.

The value given by xcw:interface defines the 'interface' version. The meaning of that value is that if another project used a definition that was later than this version, it should still be able to work with the current version. More about this later.

For example, if some other definition claims to be compatible with (expects) version 2.20020920, it will also be compatible with (be able to use) 2.20041109.2 because 2.20020920 >= 2.20020718.

When no xcw:interface is given, it's value is equal to that of xcw:current. In other words, the presence of xcw:interface inside a xcw:definition_version element is optional.

The url given in xcw:url is an option url that points to the the place where the latest version of the current file can be downloaded.

In most cases, xcw:definition_version will occur only once in any XML file, directly below the root tag: it's supposed to define the version of the current XML file. However, when the definition of some block that is maintained elsewhere has to be copied into a XML (instead of using the xcw:import tag, see below) then this copy has to be exactly like it was in the original. As such, a second xcw:definition_version can appear in the same XML, defining the version of a child element. One of the reasons this might happen is when some definition has to be available in full off-line (for example on a CD-rom, sold to people with internet). Such an XML file should not be placed on-line for public use however. It is encouraged to have only definitions on-line that contain only a single xcw:definition_version element.

Importing An External Definition

When a definition is needed for which already a seperately maintained file exists, or when such

Version Requirement

An element that refers to, or uses, an external defintion in some way, should declare the version(s) it will be compatible with by means of a (list of) version requirement(s) for that external definition, by means of a xcw:version_requirement element.

For example, if some element foobar refers to an external (in another file, other site, and/or by another author) element external defined in some namespace, then it can require a minimal version (below which the defined object becomes invalid), as follows:

<namespace> <external> <xcw:version_requirement> <xcw:compat>1.20010803</xcw:compat> <xcw:compat>2.20050725.7</xcw:compat> ... </xcw:version_requirement> </external> </namespace> <foobar> [content using `external'] </foobar>

Formally this means that the used definition of external must have a xcw:current and xcw:interface version such that interface <= compat <= current for at least one of the xcw:compat values listed.

Each definition file is only allowed a single xcw:version_requirement for each external element/object it uses.

Author

Each element definition may contain an element xcw:author in addition to the already mentioned xcw:definition_version.

The format of an xcw:author element is given below in XSD style. See http://www.w3schools.com/dtd/dtd_intro.asp for a quick tutorial on XML Shema Definition syntax.

<?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xcw.alinoe.com" xmlns="http://http://xcw.alinoe.com" elementFormDefault="qualified"> <xs:element name="author"> <xs:complexType> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="contact" type="xs:string"/> <xs:element name="homepage" type="xs:string"/> <xs:element name="public_key" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> <!ELEMENT author (name,contact,homepage?,public_key?)> <!ELEMENT name (firstname,surname,restname?)> <!ELEMENT firstname (#PCDATA)> <!ELEMENT surname (#PCDATA) -- For alphabetic ordering --> <!ELEMENT restname (#PCDATA) -- Optional names between firstname and surname --> <!ELEMENT contact (email,address?,phone?,chat?)> <!ELEMENT email (#PCDATA)> <!ELEMENT address (street,number,number_extension?,zipcode,city,state?,country)> <!ELEMENT street (#PCDATA)> <!ELEMENT number (#PCDATA)> <!ELEMENT number_extension (#PCDATA)> <!ELEMENT zipcode (#PCDATA)> <!ELEMENT city (#PCDATA)> <!ELEMENT state (#PCDATA)> <!ELEMENT country (#PCDATA)> <!ELEMENT phone (voice|mobile|fax)+> <!ELEMENT voice (#PCDATA)> <!ELEMENT mobile (#PCDATA)> <!ELEMENT fax (#PCDATA)> <!ELEMENT chat (msn|irc|icq|skype|googletalk|yahoochat|other)+> <!ELEMENT msn (#PCDATA)> <!ELEMENT irc (#PCDATA)> <!ELEMENT icq (#PCDATA)> <!ELEMENT skype (#PCDATA)> <!ELEMENT googletalk (#PCDATA)> <!ELEMENT yahoochat (#PCDATA)> <!ELEMENT other (#PCDATA)> <!ELEMENT homepage (#PCDATA)> <!ELEMENT public_key (#PCDATA)>