README
1This example shows how to perform stream-oriented, partially in-memory
2XML processing using the C++/Tree mapping. With the partially in-memory
3parsing and serialization only a part of the object model is in memory at
4any given time. With this approach we can process parts of the document
5as they become available as well as handle documents that are too large
6to fit into memory.
7
8The example consists of the following files:
9
10position.xsd
11 XML Schema which describes a simple object position vocabulary. The
12 position is represented as a potentially large series of latitude and
13 longitude measurements.
14
15position.xml
16 Sample object position document.
17
18position.hxx
19position.cxx
20 C++ types that represent the position vocabulary as well as parsing
21 and serialization functions. These are generated by XSD from
22 position.xsd.
23
24parser.hxx
25parser.cxx
26 Stream-oriented DOM parser implementation that is built on top of the
27 Xerces-C++ SAX2 parser in the progressive parsing mode. This parser
28 allows us to parse an XML document as a series of DOM fragments.
29
30serializer.hxx
31serializer.cxx
32 Stream-oriented DOM serializer implementation that allows us to
33 serialize an XML Document as a series of object model fragments.
34
35grammar-input-stream.hxx
36grammar-input-stream.cxx
37 Input stream implementation with the special-purpose schema grammar
38 decompression algorithm. It is used internally by the streaming parser.
39
40driver.cxx
41 Driver for the example. It parses the input file into a series of DOM
42 fragments which are then parsed into the object model fragments. The
43 driver prints the information from the document as it becomes available.
44 It also serializes the object model fragments into a new XML document
45 (out.xml).
46
47To run the example simply execute:
48
49$ ./driver position.xml
50
51The serialization results are written to the out.xml file.
52