XML Schema Compiler (XSC) generates vocabulary-specific C++ mapping from XML Schema. The following parts are available for download:
xsc-X.Y.Z
,
XSCRT-X.Y.Z
and
Examples-X.Y.Z
.make
in Examples-X.Y.Z/Library/Reader
and Examples-X.Y.Z/Library/Writer
./driver ../library.xml
in
Examples-X.Y.Z/Library/Reader
and
Examples-X.Y.Z/Library/Writer
--cxx-generate-writer-types
option triggers
generation of code for un-parsing in-memory representation back to DOM
which, in turn, can be saved to a file. See
Examples/Library/Writer
for a usage example. Anonymous types
are not yet supported.--cxx-banner-file
,
--cxx-header-banner-file
, --cxx-inline-banner-file
and --cxx-source-banner-file
options allow to specify banner
files which are copied at the beginning of generated files.--cxx-char-type type-name
option allows to select
character type for C++ mapping. char
and wchar_t
are supported out of the box. Other types may require runtime
specialization.New --cxx-namespace-regex /pattern/replacement/
option
allows to specify custom XML Schema namespace to C++ namespace mapping.
All regular expressions are pushed into a stack with the last specified expression considered first. The first match that succeeds is used. The regex is applied to a string of the form
file-name namespace
For example
XMLSchema.xsd http://www.w3.org/2001/XMLSchema
The file-name
for the current translation unit is
empty e.g., if you have file foo.xsd
with the namespace
http://foo.com/schema
and you run xsc
on this
file, then the string in question would be
http://foo.com/schema
(note the preceding space).
The following three steps are performed for each regex until match is found:
foo::bar
). If this test succeeds the result is used as
a C++ namespace.group
.http://www.example.com/foo/bar/baz
are translated into
nested C++ namespaces of form foo::bar::baz
.anyType
and
attributes of type anySimpleType
.#include
, proper inclusion
(i.e., inclusion with the same target namespace) - translates to
#include
, and chameleon inclusion (i.e., inclusion without
target namespace) - translates into physical sourcing with code
generated in hosted namespace.ref
'erencing.--cxx-generate-extended-rtti
option which triggers
generation of extended run-time type information (inheritance graph
at the moment).--cxx-generate-traversal-types
option which triggers
generation of traversal mechanism. It is usually useful for performing
operations on complex recursive and/or dynamically-typed
(ID
/IDREF
) graphs. See
Examples/Library
for introduction to traversal.