CMDI Best Practices (OLD)
  • Introduction
  • Scope
  • How to use this Guide
  • Outline
  • CMDI Workflow
  • Modelling Component Metadata
    • Components
    • Profiles
    • Workflow
    • Problem indicators (“bad smells”)
  • Authoring Component Metadata Records
    • General XML
    • The envelope
    • The component section
    • Workflow
    • Problem indicators (“bad smells”)
  • Common approaches/problems
    • Multilingual metadata
    • Dealing with uncertainty
Powered by GitBook
On this page
  • X1: Include a reference to the profile XSD generated by the Component Registry
  • X2: Use common namespace prefixes
  • X3: Use UTF-8 encoding
  1. Authoring Component Metadata Records

General XML

PreviousAuthoring Component Metadata RecordsNextThe envelope

Last updated 7 years ago

X1: Include a reference to the profile XSD generated by the Component Registry

For each profile stored in the Component Registry a dynamically generated XSD is available. The URL of this XSD is available in the Info dialog of a profile and should be included in the schemaLocation attribute on the CMD root element. This enables validation of a CMD record by general XSD validators, including the CMDI Validator. The Component Registry URL should be used as it ensures that fixes in the transformation from a profile specification into an XSD are included in the validation process.

X2: Use common namespace prefixes

Namespace prefixes are officially just syntactic sugar in XML, i.e., provide a convenient shortcut. However, using common prefixes enable users to quickly assess the scope of an element. The CMDI 1.2 specification recommends the following prefixes for the namespaces URIs in CMDI:

Prefix

Namespace Name

Comment

Recommended Syntax

cmd

CMDI instance (general/envelope)

prefixed

cmdp

CMDI payload (profile specific)

prefixed

cue

Cues for tools

prefixed

xs

XML Schema

prefixed

xsi

XML Schema instance

prefixed

See section regarding validation, which implies well-formed XML.

X3: Use UTF-8 encoding

The encoding of a CMD record, i.e., XML documents in general, doesn’t have to be stated explicitly. It can be provided in various, possibly conflicting ways: via a Byte Order Marker (BOM), in the XML declaration of the document or a HTTP header. The best practice is to align all these methods to express an UTF-8 encoding, but include at least the XML declaration to indicate the encoding used.

3.4
http://www.clarin.eu/cmd/1
http://www.clarin.eu/cmd/1/profiles/{profileId}
http://www.clarin.eu/cmd/cues/1
http://www.w3.org/2001/XMLSchema
http://www.w3.org/2001/XMLSchema-instance