XSD/Schema compilation checklist
From Code Synthesis Wiki
(Difference between revisions)
Revision as of 09:33, 17 February 2008 Boris (Talk | contribs) ← Previous diff |
Revision as of 09:37, 17 February 2008 Boris (Talk | contribs) (→Common Options) Next diff → |
||
Line 10: | Line 10: | ||
* To place the generated code into a specific directory, use the <code>--output-dir</code> options, for example, <code>--output-dir src</code>. | * To place the generated code into a specific directory, use the <code>--output-dir</code> options, for example, <code>--output-dir src</code>. | ||
+ | |||
+ | * You can select the character type that should be used in the generated code with the <code>--char-type</code> option. Available choices are <code>char</code> (default), and <code>wchar_t</code>. | ||
* If you have several schema files and some of them are not self-sufficient (that is, you get XML Schema errors when trying to compile them with XSD) or have cyclic dependecies that involve inheritance (that is, you get C++ errors when compiling the generated code with the message saying that the base type is undefined) then you will need to use the file-per-type compilation mode which is turned on with the <code>--file-per-type</code> option. For more information about the file-per-type mode see this [http://codesynthesis.com/~boris/blog/2008/02/13/codesynthesis-xsd-3-1-0-released/ blog post]. | * If you have several schema files and some of them are not self-sufficient (that is, you get XML Schema errors when trying to compile them with XSD) or have cyclic dependecies that involve inheritance (that is, you get C++ errors when compiling the generated code with the message saying that the base type is undefined) then you will need to use the file-per-type compilation mode which is turned on with the <code>--file-per-type</code> option. For more information about the file-per-type mode see this [http://codesynthesis.com/~boris/blog/2008/02/13/codesynthesis-xsd-3-1-0-released/ blog post]. |
Revision as of 09:37, 17 February 2008
This page provides a checklist-like run through the most commonly used XSD options. For more details on each option as well as for the complete list of options refer to the XSD command line interface documentation (man pages).
Contents |
Common Options
The following options are available for all mappings:
- You can map any XML Schema namespace (including the no-namespace case and built-in XML Schema namespace) to a custom C++ namespace with the
--namespace-map
option, for example,--namespace-map http://www.example.com/xmlns/my=ExampleInc::My
. To place the generated code for a schema without a target namespace into a C++ namespace, use the empty string as XML Schema namespace:--namespace-map =My
. To map a set of namespaces at once the--namespace-regex
option is available.
- To place the generated code into a specific directory, use the
--output-dir
options, for example,--output-dir src
.
- You can select the character type that should be used in the generated code with the
--char-type
option. Available choices arechar
(default), andwchar_t
.
- If you have several schema files and some of them are not self-sufficient (that is, you get XML Schema errors when trying to compile them with XSD) or have cyclic dependecies that involve inheritance (that is, you get C++ errors when compiling the generated code with the message saying that the base type is undefined) then you will need to use the file-per-type compilation mode which is turned on with the
--file-per-type
option. For more information about the file-per-type mode see this blog post.
C++/Tree Mapping Options
The following options are specific to the C++/Tree mapping:
C++/Parser Mapping Options
The following options are specific to the C++/Parser mapping: