Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

About X-definition

X-definition is registered technology of the Syntea software group a.s., for processing of the XML documents or JSON data.

For the purpose of describing the structure of XML documents or JSON data, their validation, processing and creation, this tool was developed by Syntea Software Group Inc. It allows the user to not only define the structure of XML documents or JSON data, but also to describe specifically their processing and construction.


This project is implementation for platform Java 1.6+.


The source code for this project is licensed under Apache 2.0 license.


You can try following examples online at:

Example 1: Essential concepts

Let´s have the following XML data:
    FirstName = "Andrew"
    LastName  = "Aardvark"
    EnterDate = "1996-03-12"
    Salary    = "21700"
        Street = "Broadway"
        Number = "255"
        Town   = "Beverly Hills"
        State  = "CA"
        Zip    = "90210"
This is the complete X-definition file with the model of the XML data on the left:
<xd:def xmlns:xd="" xd:root="Employee">
        FirstName = "required string()"
        LastName  = "required string()"
        EnterDate = "required date()"
        Salary    = "optional decimal()"
            Street = "required string()"
            Number = "required int()"
            Town   = "required string()"
            State  = "required string()"
            Zip    = "required int()"
        <Competence xd:script = "occurs 1..5">
            required string()

Example 2: References

XML data:
  <Father    GivenName  = "John"
             FamilyName = "Smith"
             PersonalID = "7107130345"
             Salary     = "18800" />
  <Mother    GivenName  = "Jane"
             FamilyName = "Smith"
             PersonalID = "7653220029"
             Salary     = "19400" />
  <Son       GivenName  = "John"
             FamilyName = "Smith"
             PersonalID = "9211090121" />
  <Daughter  GivenName  = "Jane"
             FamilyName = "Smith"
             PersonalID = "9655270067" />
  <Residence Street     = "Small"
             Number     = "5"
             Town       = "Big"
             Zip        = "12300" />
Model of the XML data:
  <Father    xd:script = "occurs 0..1; ref Person" />
  <Mother    xd:script = "occurs 1..1; ref Person" />
  <Son       xd:script = "occurs 0..*; ref Person" />
  <Daughter  xd:script = "occurs 0..*; ref Person " />
  <Residence xd:script = "occurs 1;    ref Address" />

<Person GivenName  = "string()" 
        FamilyName = "string()" 
        PersonalID = "long()"
        Salary     = "optional int()" />
<Address Street = "string()"
         Number = "int()"
         Town   = "string()"
         Zip    = "int()" />


This document describes the programming language and the technology called “X‑definition“. X‑definition is designed for description and processing of data in the form of XML or JSON.

X-definition is a tool that provides the description of both the structure and the properties of data values in an XML document. Moreover, the X-definition allows the description of the processing of specified XML objects. Thus X‑definitions may replace existing technologies commonly used for XML validation - namely the DTD (Data Type Definition) or the XML schemas and Schematron. With X-definition it is also possible to describe the construction of XML documents (or the transformation of XML data). X-definitions provides also generation of JAVA class objects similar way as JAXB technology.

X-definition enables the merging in one source of both the validation of XML documents and processing of data (i.e. using actions assigned to events when XML objects are processed). Compared to the “classical” technologies based on DTD and XML schemas, the advantage of X-definitions is (not only) higher readability and easier maintenance. X‑definition has been designed for processing of XML data files of unlimited size, up to many gigabytes.

A principal property of X-definition is maximum respect for the structure of the described data. The form of X‑definition is an XML document with a structure similar to the described XML data. This makes possible quickly and intuitively describe given XML data and its processing. In many cases it requires just to replace the values in the XML data by the description written in the X‑definition X‑script language. You can also gradually add to your X‑script required actions providing data processing. You can take a step-by-step approach to your work.

It is assumed that the reader already knows the elementary principles of XML. To get the most out of this document, you should also have at least basic knowledge of the Java programming language.

X‑definition technology enables also to generate the source code of Java classes representing XML elements described by X‑definition. Such class is called X‑component. You can use the instances of XML data in the form of X‑components in Java programs (similar way as in the JAXB technology).

The term "X‑definition" we use in the two different meanings: either as a name of the programming language or as an XML element containing the code of X‑definition language.

For the complete documentation see the directory xdef/src/documentation.

Usage in other projects

Check and download available versions


For maven projects

Configuration file pom.xml:

  • dependency on release version in the central maven repository:

            <version>[release version]</version>
  • dependency on release or snapshot version in

            <version>[release or snapshot version]</version>

Building this project

Source code at GitHub:


  • download project X-definition, eg. from GitHub
  • install java
  • install maven
  • configure maven
    • configure maven-plugin toolchain

Frequent building operations:

  • cleaning before any compiling, building, deploying, etc.:

    mvn clean
  • compile all java-resources, respectively all compilable resources:

    mvn compile
  • build snapshot package:

    mvn package
  • build snapshot package avoiding junit-tests:

    mvn package -PskipTests
  • build release package:

    mvn package -Prelease
  • build release packages including javadoc, sources, documentation:

    mvn package -Prelease,javadoc,sources

Deploying to the maven central repository


  • satisfy prerequisities for building
  • install the pgp-managing software GnuPG (
  • configure maven:
    • access to pgp-key
    • access to maven repository manager (having id "ossrh" in the file pom.xml)


  • deploy snapshot packages to the snapshot-repository

    mvn deploy -Pjavadoc,sources,dm-ossrh
  • release the version of X-definition to the maven central repository (throw the repository

    mvn deploy -Prelease,javadoc,sources,dm-ossrh