Infothek
Technical/XML: Regarding fixed namespace prefixes (rsm:,ram:...)
veröffentlicht von usegroup am 02.06.2023Themen: Grundlagen, Sicherheit & Compliance
Branche: Branchenunabhängig
Dokumentenart: Fachartikel
This went uncontested from June 23 to Nov 24 but now has rightfully been scrutinized. We're working on it: It is no longer sure if the Design Rules may only cover the schema files, not the xml instances. Jochen 24.11.2024. The original read:
XML allows to choose mix different formats using namespaces and those namespaces can have arbitrary namespace prefixes. In UBL there is a recommendation how these prefixes can be named but in CII the namespace prefixes rsm:, ram:, udt:, qdt: and alike are actually mandatory.
Since this is quite surprising and quite under-documented I'll quote Andreas Pelekies who wrote referring to the UN/CEFACT XML Naming and Design Rules v3: There is a chapter about conformance. [R B998] Category 2 states that an organisation can choose to change the prefix, but with a weaker conformance to UN/CEFACT. This leads to usergroup-specific rules.
On the other hand, [R 9224] states that XML Schema (not instance) MUST use the defined structure.
At CEN level this discussion about mandatory prefixes was done as well and guys from the UN/CEFACT library team confirmed the mandatory usage "in practice". This is why EN16931 syntax bindings, XRechnung and all EN16931 based implementations use the fixed namespaces in a mandatory way. In a way, it is mandatory by fact, as UN/CEFACT themselves only use the fixed namespaces in all of their artefacts as well as their Schematron. The latter makes them technically mandatory. The NDR chapter "5.6.2 Namespace Tokens" indeed states that the namespace tokens "will be created using three character representations for each unique namespace". As this NDR is a binding guide for UN/CEFACT and the published schemas and examples are binding, the prefix names are fixed as they are published. For example, [R 9FD1] says that for code lists "clm" MUST be used. In chapter 8.6.3.2 it is referenced again for a different constellation. So the rule from 5.6.2 does not allow prefixes with more or less than 3 characters.
Chapter 8.7.2.1 makes, in general, the prefix mandatorily to be equal to the three letter identifierscheme of common identifier schemes. See also [R 9CCF] with conformance category 1.
Chapter 8.7.3.2 states "uses the namespace token for the data package in which it is defined". As the data package abbreviations are mandatory (RSM, RAM, QDT, UDT, ...) This implicitly makes the prefixes mandatory again.
So in summary, we have explicitly declared a fixed NS clm. Although it is not stated explicitly, the overall figure drawn by the NDR together with the current and all historical publications as well as the CEN/TS 16931-3-3, CEF, XRechnung etc it is mandatory, if full conformance with the NDRs is to be achieved. If someone wants to change this, the respective organisation should make a change request at UN/CEFACT level.