2005 February


Table of Contents

KDE XML Policy
Namespaces
Application Specific Namespaces
Public Namespaces
Element and Attribute Names
Addition for W3C XML Schemata
Schema Languages

KDE XML Policy

The key words must, must not, required, shall, shall not, should, should not, recommended, may, and optional in this policy are to be interpreted as described in RFC 2119. Note that for reasons of style, these words are not capitalized in this document.

This policy specifies recommendations and conventions for XML related technologies in KDE.

Namespaces

XML namespaces can be divided in two categories: namespaces for application specific vocabularies, and namespaces for public vocabularies.

Application Specific Namespaces

By application specific namespaces is meant namespaces for vocabularies which only applies for the usage scenario of a particular application. For example, a vocabulary used internally or by 3rd party developers of that application.

This policy does not apply for application specific namespaces but leaves it to the developers in question.

Public Namespaces

By public namespaces is meant namespaces for vocabularies which are part of KDE's cross-applications technologies, and are used by arbitrary applications. They are typically part of the kdelibs package.

All KDE's public namespaces must:

  • Be valid URIs, as per RFC 3986.

  • Start with http://www.kde.org/standards/, which is KDE's standardized namespace URI, followed by an identifier which is not already in use, and sub-sequently terminated with a trailing slash("/"). After that resulting string, the string may be extended in an arbitrary way, while staying within the constraints of the URI syntax. For example, the namespace http://www.kde.org/standards/kcfg/2.0 as well as http://www.kde.org/standards/ktechnology/ are valid according to this policy.

Table 1. Current Public Namespaces

URIDescription
http://www.kde.org/standards/kcfg/1.0KConfigXT's *.kcfg files.

The addition of new namespaces must be discussed on the mailinglist kde-core-devel@kde.org, and, if decided to be included, must result in this policy being revised to list the new namespace.

Element and Attribute Names

Element and attribute names part of public XML vocabularies should follow the naming convention that:

  • The initial letter of each word is capitalized, except the first word, if any, which is not.

  • Abbrevations, such as XML or URI, should be capitalized, except if they are the first word.

As example, these are all valid names: car, replacementURI, and vehicleContainer.

This naming convention resembles the one of Qt's and KDE's C++ APIs.

Addition for W3C XML Schemata

In addition to the naming conventions for arbitrary XML vocabularies, the following recommendations applies for W3C XML Schema documents:

  • The name for type declarations should end with Type. For example:

    
    <xsd:complexType name="containerType">
        <!-- content -->
    </xsd:complexType>
    
    <xsd:element name="container" type="containerType" />
    
                                
  • The design of the Schema should strive for having global type and element declarations, such that the Schema is flexible for future evolvements, such as inheritance and component reuse. In other words, the design should strive for being “flat”.

Schema Languages

XML vocabularies should be typed in W3C XML Schema. The same vocabularies may in addition be expressed in other schema languages, such as RELAX NG.