C++

Based on the XML Schema.

CodeSynthesis XSD is an open-source, cross-platform W3C XML Schema to C++ data binding compiler.

Windows Batch File

run_xsd.cmd
 1set XSD_HOME=..\..\model_based\xsd_variants
 2set XSD_EXE_FOLDER=C:\Programs\c++xsd\xsd-4.2.0-x86_64-windows10\bin
 3rem set XSD_EXE_FOLDER=E:\DDI\CDI\SyntaxRepresentation\encoding\c++\xsd-4.2.0-x86_64-windows10\bin
 4
 5%XSD_EXE_FOLDER%\xsd.exe cxx-tree --root-element DDICDIModels %XSD_HOME%\ddi-cdi_42_noXsdTypeInName.xsd
 6rem %XSD_EXE_FOLDER%\xsd.exe cxx-tree --root-element DDICDIModels %XSD_HOME%\ddi-cdi_43_noXsdTypeInName.xsd
 7rem %XSD_EXE_FOLDER%\xsd.exe cxx-tree --root-element DDICDIModels %XSD_HOME%\ddi-cdi_44_noXsdTypeInName.xsd
 8rem %XSD_EXE_FOLDER%\xsd.exe cxx-tree --root-element DDICDIModels %XSD_HOME%\ddi-cdi_45_noXsdTypeInName.xsd
 9
10set XSD_HOME=
11set XSD_EXE_FOLDER=

Source file run_xsd.cmd

Generated Files

A code file and a header file are generated for C++.

C++ Code File Fragment

Fragment of ddi-cdi_44_noXsdTypeInName.cxx
 1#include <xsd/cxx/pre.hxx>
 2
 3#include "ddi-cdi_44_noXsdTypeInName.hxx"
 4
 5namespace XMLSchema
 6{
 7  // DDICDIModels
 8  //
 9
10  const DDICDIModels::Activity_sequence& DDICDIModels::
11  Activity () const
12  {
13    return this->Activity_;
14  }
15
16  DDICDIModels::Activity_sequence& DDICDIModels::
17  Activity ()
18  {
19    return this->Activity_;
20  }
21
22  void DDICDIModels::
23  Activity (const Activity_sequence& s)
24  {
25    this->Activity_ = s;
26  }

Source file ddi-cdi.cxx

C++ Header File Fragment

Fragment of ddi-cdi_44_noXsdTypeInName.hxx
 1    // AuthorizationSource
 2    //
 3    typedef ::XMLSchema::AuthorizationSource AuthorizationSource_type;
 4    typedef ::xsd::cxx::tree::sequence< AuthorizationSource_type > AuthorizationSource_sequence;
 5    typedef AuthorizationSource_sequence::iterator AuthorizationSource_iterator;
 6    typedef AuthorizationSource_sequence::const_iterator AuthorizationSource_const_iterator;
 7    typedef ::xsd::cxx::tree::traits< AuthorizationSource_type, char > AuthorizationSource_traits;
 8
 9    const AuthorizationSource_sequence&
10    AuthorizationSource () const;
11
12    AuthorizationSource_sequence&
13    AuthorizationSource ();
14
15    void
16    AuthorizationSource (const AuthorizationSource_sequence& s);
17
18    // Category
19    //
20    typedef ::XMLSchema::Category Category_type;
21    typedef ::xsd::cxx::tree::sequence< Category_type > Category_sequence;

Source file ddi-cdi.hxx