Overview
In the following article, I tried creating an ODD.
The above uses a tool called Roma, and you can see that the created ODD has the following output formats available.

Specifically, the available formats are “RELAX NG Schema,” “RELAX NG Compact,” “W3C Schema,” “Document Type Definition,” and “ISO Schematron Constraints.”
I asked GPT-4 about the differences between these formats and am sharing the results here. There may be some inaccuracies, but I hope this serves as a useful reference.
Differences Between Relax NG (RNG) and W3C XML Schema
Relax NG (RNG) and W3C XML Schema are both schema languages for defining the structure and content of XML documents, but they have several important differences:
Notation:
- RNG: Provides two syntaxes. One is XML-based, and the other is a more compact non-XML syntax.
- W3C XML Schema: Provides only XML-based syntax.
Flexibility and Clarity:
- RNG: Very flexible and designed to be human-readable. It takes a pattern-based approach, enabling more intuitive modeling.
- W3C XML Schema: Takes a more strict and formal approach with a complex type system, which enables powerful data typing.
Data Typing:
- RNG: Data types are supported through Datatype Libraries, but they are not as diverse as those in W3C XML Schema.
- W3C XML Schema: Provides rich built-in data types and allows precise data type constraints to be set.
Extensibility:
- RNG: Schemas can be easily extended due to their simplicity and flexibility.
- W3C XML Schema: While extensible, its more complex structure can make understanding and implementation more difficult.
Adoption:
- RNG: Despite its simplicity and powerful modeling capabilities, it has not been as widely adopted as W3C XML Schema.
- W3C XML Schema: More commonly used and supported as standard in many XML processing tools and libraries.
Despite these differences, both languages share the common purpose of defining the structure of XML documents and validating document conformance. The choice often depends on individual project needs and developer preferences.
How Does DTD (Document Type Definition) Relate?
DTD (Document Type Definition) is a specification for defining the structure of XML documents. It predates both W3C XML Schema and Relax NG (RNG) and has limited ways to describe constraints. DTD is very simple and has been a standard method used since the early days of XML, but it does not support more advanced concepts such as namespaces and data types.
Compared to W3C XML Schema and RNG, DTD has the following limitations:
- Limited support for data types.
- Does not directly support namespaces.
- Lower flexibility and reusability.
Conversion from DTD to W3C XML Schema or RNG is possible, but due to the functional limitations mentioned above, the resulting schema may not be fully equivalent. Additionally, advanced features available in W3C XML Schema and RNG cannot be expressed in DTD, making reverse conversion even more difficult. When performing mutual conversion, tools or manual adjustments are required.
How Does ISO Schematron Relate?
ISO Schematron is another schema language for validating the structure and business rules of XML documents. Schematron takes a different approach from other schema languages, focusing primarily on pattern matching and rule-based validation. The main purpose of Schematron is to verify whether an XML document meets specific conditions, and it can express complex structural and semantic constraints based on specific rules.
In relation to Relax NG and W3C XML Schema, Schematron differs in the following ways:
Constraint Expression:
- Schematron uses XPath to describe rules. This allows expressing conditions and business logic that are difficult to express with W3C XML Schema or Relax NG.
Complementarity:
- Schematron is often used complementarily with W3C XML Schema and Relax NG. This is because Schematron is better suited for validating business logic and document rules rather than structural validation.
Ease of Use:
- Schematron is relatively simple and easy to learn, allowing developers to quickly create rules and implement schemas that validate complex conditions.
Tool Support:
- Tool support for Schematron is not as extensive as for W3C XML Schema, but it is supported in many XML development environments.
Maintenance:
- Schematron rules are generally easy to maintain and are considered understandable by end users and domain experts.
In practice, structural validation is performed with W3C XML Schema or Relax NG, and Schematron is additionally used to validate specific business rules and constraints. This enables flexible and powerful validation of XML documents.
Summary
The relationships between the elements discussed above are illustrated in the following paper.
https://www.researchgate.net/figure/TEI-ODD-customization-file_fig1_345054399

Having an understanding of these relationships makes it easier to understand Roma’s output formats.
As mentioned before, there may be inaccuracies in the descriptions, but I hope this serves as a useful reference.
Other
Are W3C XML Schema and XSD the Same Thing?
Yes, W3C XML Schema and XSD essentially refer to the same thing.
W3C XML Schema is a language developed by the World Wide Web Consortium (W3C) for defining the structure and data types of XML documents. It allows specifying types and constraints for XML documents and verifying whether documents conform to specific formats and rules.
XSD (XML Schema Definition) is the language used to describe W3C XML Schemas, and is also used as a file extension (.xsd). By using XML Schema, you can precisely specify data types, structure, and other constraints for elements and attributes of XML documents.
XML Schema was designed as a more powerful alternative to DTD (Document Type Definition) and provides a more rigorous and richer means for XML data exchange and validation.