-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
107 lines (69 loc) · 2.54 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
Release:
========
This package contains the XPathReader class for accessing document
elements via XPath in C++. This package uses libxml -- you need to
get a good recent version (I use 2.5.1).
Configuration
=============
GNU autoconf / automake style configuration. You need to provide the
location of the libxml2 installation using the --with-libxml2=<dir>
option to configure:
eg: (for me on the Edinburgh Physics machines)
./configure --with-libxml2=/Home/bj/Devel/SciDAC/install/libxml2
then type
gmake
to make the library.
gmake install
to install as usual.
Running:
gmake check
will build the examples in the examples/ directory.
Documentation
=============
Almost as much as for libxml :) (or should that be :( )
I have added excessive comments to the header files:
basic_xpath_reader.h
and
xpath_reader.h
in the include directory, at the start of the files. I recommend
you read them.
Examples
========
I provide 3 examples in the examples directory:
i) basic_xpath_reader_test
--------------------------
This is effectively an XPath shell.
Run: basic_xpath_reader_test foo.xml
and type XPath expression.
Typing / should return the whole document.
ii) basic_xpath_reader_test2
----------------------------
This actually tries to get at bits of the XML and store them in
variables/classes. THe output should produce a bunch of failure
and success messages (it contains deliberately erroneous queries)
iii) xpath_reader_test2
-----------------------
Much like basic_xpath_reader_test2 but using the full XPathReader.
Also matches some weird types like complex'es and arrays etc.
Conformance
===========
XML: I use libxml2 and this sets an upper limit on my standard
conformance. I then deal probably dodgily with namespaces.
(see www.xmlsoft.org for details of libxml2 conformance)
C++: I make pervasive use of ANSI standard io and string streams
I also make use of templates a great deal, but hopefully
only in ANSI/ISO C++ ways.
My code compiled with g++-3.2 -- 'nuff said.
(earlier eg g++-2.x series compilers may barf).
Future
======
immediate/near:
Some kind of writer class API, so we can write as well as read.
intermediate/medium distant:
Autogeneration of unmarshal (read?) functions from some kind
of mapfile, which contains XPath (perhaps a sophisticated XSLT?).
This could be done by PERL/Python. The source for unmarshalling
would use XPathReader...
far/distant/perhaps never:
Autogeneration of the mapping file by reading XMLSchema
=> Complete C++ Open Source Data Binding Framework.