diff options
Diffstat (limited to 'xsd/doc/cxx/parser')
-rw-r--r-- | xsd/doc/cxx/parser/guide/index.xhtml.in | 68 |
1 files changed, 37 insertions, 31 deletions
diff --git a/xsd/doc/cxx/parser/guide/index.xhtml.in b/xsd/doc/cxx/parser/guide/index.xhtml.in index a72b06e..96d06e2 100644 --- a/xsd/doc/cxx/parser/guide/index.xhtml.in +++ b/xsd/doc/cxx/parser/guide/index.xhtml.in @@ -350,12 +350,14 @@ <li><a href="https://www.codesynthesis.com/projects/xsd/documentation/xsd.xhtml">XSD Compiler Command Line Manual</a></li> - <li>The <code>examples/cxx/parser/</code> directory in the XSD - distribution contains a collection of examples and a README - file with an overview of each example.</li> + <li>The <code>cxx/parser/</code> directory in the + <a href="https://cppget.org/xsd-examples">xsd-examples</a> package + contains a collection of examples and a README file with an overview + of each example.</li> - <li>The <code>README</code> file in the XSD distribution explains - how to compile the examples on various platforms.</li> + <li>The <code>README</code> file in the + <a href="https://cppget.org/xsd-examples">xsd-examples</a> package + explains how to build the examples.</li> <li>The <a href="https://www.codesynthesis.com/mailman/listinfo/xsd-users">xsd-users</a> mailing list is the place to ask technical questions about XSD and the C++/Parser mapping. @@ -481,8 +483,9 @@ <p>In this chapter we will examine how to parse a very simple XML document using the XSD-generated C++/Parser skeletons. The code presented in this chapter is based on the <code>hello</code> - example which can be found in the <code>examples/cxx/parser/</code> - directory of the XSD distribution.</p> + example which can be found in the <code>cxx/parser/</code> directory in + the <a href="https://cppget.org/xsd-examples">xsd-examples</a> + package.</p> <h2><a name="2.1">2.1 Writing XML Document and Schema</a></h2> @@ -550,7 +553,7 @@ </p> <pre class="terminal"> -$ xsd cxx-parser --xml-parser expat hello.xsd +$ xsd cxx-parser --std c++11 --xml-parser expat hello.xsd </pre> <p>The <code>--xml-parser</code> option indicates that we want to @@ -754,8 +757,8 @@ main (int argc, char* argv[]) on these options refer to the <a href="https://www.codesynthesis.com/projects/xsd/documentation/xsd.xhtml">XSD Compiler Command Line Manual</a>. The <code>'generated'</code> example - in the XSD distribution shows the sample implementation generation - feature in action.</p> + in the <a href="https://cppget.org/xsd-examples">xsd-examples</a> package + shows the sample implementation generation feature in action.</p> <h2><a name="2.4">2.4 Compiling and Running</a></h2> @@ -767,8 +770,8 @@ main (int argc, char* argv[]) </p> <pre class="terminal"> -$ c++ -I.../libxsd -c driver.cxx hello-pskel.cxx -$ c++ -o driver driver.o hello-pskel.o -lexpat +$ c++ -std=c++11 -I.../libxsd -c driver.cxx hello-pskel.cxx +$ c++ -std=c++11 -o driver driver.o hello-pskel.o -lexpat $ ./driver hello.xml Hello, sun! Hello, moon! @@ -776,9 +779,10 @@ Hello, world! </pre> <p>Here <code>.../libxsd</code> represents the path to the - <code>libxsd</code> directory in the XSD distribution. - We can also test the error handling. To test XML well-formedness - checking, we can try to parse <code>hello-pskel.hxx</code>:</p> + <a href="https://cppget.org/libxsd">libxsd</a> package root + directory. We can also test the error handling. To test XML + well-formedness checking, we can try to parse + <code>hello-pskel.hxx</code>:</p> <pre class="terminal"> $ ./driver hello-pskel.hxx @@ -1490,7 +1494,7 @@ gender ::gender ::gender; option to let the XSD compiler know about our type map:</p> <pre class="terminal"> -$ xsd cxx-parser --type-map people.map people.xsd +$ xsd cxx-parser --std c++11 --type-map people.map people.xsd </pre> <p>If we now look at the generated <code>people-pskel.hxx</code>, @@ -1618,9 +1622,9 @@ namespace http://www.example.com/xmlns/my <code>std::wstring</code> depending on the character type selected (see <a href="#5.2"> Section 5.2, "Character Type and Encoding"</a> for more information). The binary XML Schema - types are mapped to either <code>std::auto_ptr<xml_schema::buffer></code> - or <code>std::unique_ptr<xml_schema::buffer></code> - depending on the C++ standard selected (C++98 or C++11, + types are mapped to either <code>std::unique_ptr<xml_schema::buffer></code> + or <code>std::auto_ptr<xml_schema::buffer></code> + depending on the C++ standard selected (C++11 or C++98, respectively; refer to the <code>--std</code> XSD compiler command line option for details).</p> @@ -1738,7 +1742,8 @@ people ::people; recompile our schema and move on to implementing the parsers:</p> <pre class="terminal"> -$ xsd cxx-parser --xml-parser expat --type-map people.map people.xsd +$ xsd cxx-parser --std c++11 --xml-parser expat --type-map people.map \ + people.xsd </pre> <p>Here is the implementation of our three parsers in full. One @@ -1882,8 +1887,8 @@ main (int argc, char* argv[]) <pre class="terminal"> -$ c++ -I.../libxsd -c driver.cxx people-pskel.cxx -$ c++ -o driver driver.o people-pskel.o -lexpat +$ c++ -std=c++11 -I.../libxsd -c driver.cxx people-pskel.cxx +$ c++ -std=c++11 -o driver driver.o people-pskel.o -lexpat $ ./driver people.xml first: John last: Doe @@ -1917,12 +1922,12 @@ age: 28 <h2><a name="5.1">5.1 C++ Standard</a></h2> - <p>The C++/Parser mapping provides support for ISO/IEC C++ 1998/2003 (C++98) - and ISO/IEC C++ 2011 (C++11). To select the C++ standard for the + <p>The C++/Parser mapping provides support for ISO/IEC C++ 2011 (C++11) + and ISO/IEC C++ 1998/2003 (C++98). To select the C++ standard for the generated code we use the <code>--std</code> XSD compiler command line option. While the majority of the examples in this guide use - C++98, support for the new functionality and library components - introduced in C++11 are discussed throughout the document.</p> + C++11, the document explains the C++11/98 usage difference and so + they can easily be converted to C++98.</p> <h2><a name="5.2">5.2 Character Type and Encoding</a></h2> @@ -2354,9 +2359,10 @@ private: <p>Most of code presented in this section is taken from the <code>polymorphism</code> example which can be found in the - <code>examples/cxx/parser/</code> directory of the XSD distribution. - Handling of <code>xsi:type</code> and substitution groups when used - on root elements requires a number of special actions as shown in + <code>cxx/parser/</code> directory in the + <a href="https://cppget.org/xsd-examples">xsd-examples</a> package. + Handling of <code>xsi:type</code> and substitution groups when used on + root elements requires a number of special actions as shown in the <code>polyroot</code> example.</p> @@ -2754,8 +2760,8 @@ namespace xml_schema <p>The return type of the <code>base64_binary_pimpl</code> and <code>hex_binary_pimpl</code> parser implementations is either - <code>std::auto_ptr<xml_schema::buffer></code> (C++98) or - <code>std::unique_ptr<xml_schema::buffer></code> (C++11), + <code>std::unique_ptr<xml_schema::buffer></code> (C++11) or + <code>std::auto_ptr<xml_schema::buffer></code> (C++98), depending on the C++ standard selected (<code>--std</code> XSD compiler option). The <code>xml_schema::buffer</code> type represents a binary buffer and its interface is presented below.</p> |