Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 23-Aug-2017 | - | ||||
README | H A D | 23-Aug-2017 | 1.3 KiB | 45 | 34 | |
driver.cxx | H A D | 23-Aug-2017 | 2.6 KiB | 110 | 79 | |
library-pimpl.cxx | H A D | 23-Aug-2017 | 2.6 KiB | 184 | 137 | |
library-pimpl.hxx | H A D | 23-Aug-2017 | 1.9 KiB | 136 | 87 | |
library.hxx | H A D | 23-Aug-2017 | 2.8 KiB | 242 | 156 | |
library.map | H A D | 23-Aug-2017 | 320 | 16 | 13 | |
library.xml | H A D | 23-Aug-2017 | 1.2 KiB | 53 | 35 | |
library.xsd | H A D | 23-Aug-2017 | 2.1 KiB | 79 | 54 | |
makefile | H A D | 23-Aug-2017 | 3.7 KiB | 111 | 64 |
README
1This example shows how to use the C++/Parser mapping to construct 2a custom in-memory object model from XML instance documents. 3 4The example consists of the following files: 5 6library.xsd 7 XML Schema which describes a library of books. 8 9library.xml 10 Sample XML instance document. 11 12library.hxx 13 Types that describe a library of books in C++. These are 14 hand-written. 15 16library.map 17 Type map. It maps XML Schema types defined in library.xsd 18 to the C++ types defined in library.hxx. 19 20library-pskel.hxx 21library-pskel.ixx 22library-pskel.cxx 23 Parser skeletons generated by XSD from library.xsd and 24 library.map. 25 26library-pimpl.hxx 27library-pimpl.cxx 28 Parser implementations that construct the custom in-memory 29 object model from an XML instance using the types from 30 library.hxx. These are hand-written implementations of 31 the parser skeletons defined in library-pskel.hxx. 32 33driver.cxx 34 Driver for the example. It first constructs a parser 35 instance from all the individual parsers found in 36 library-pimpl.hxx. In then invokes this parser instance 37 to parse the input file and produce the in-memory 38 object model. Finally, it prints the contents of the 39 in-memory object model to STDERR. 40 41To run the example on the sample XML instance document simply 42execute: 43 44$ ./driver library.xml 45