-
Notifications
You must be signed in to change notification settings - Fork 2
/
RelaxNG.h
58 lines (45 loc) · 1.44 KB
/
RelaxNG.h
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
#ifndef RELAXNG_H
#define RELAXNG_H
namespace rng {
const QString rngns = QStringLiteral("http://www.w3.org/1999/xhtml");
const QString grammarTag = QStringLiteral("grammar");
const QString defineTag = QStringLiteral("define");
const QString startTag = QStringLiteral("start");
const QString optionalTag = QStringLiteral("optional");
const QString dataLibraryTag = QStringLiteral("dataLibrary");
const QString empty;
using GrammarTag = XmlTag<QString,&rngns, &grammarTag>;
using DefineTag = XmlTag<QString,&rngns, &defineTag>;
using StartTag = XmlTag<QString,&rngns, &startTag>;
using OptionalTag = XmlTag<QString,&rngns, &optionalTag>;
using DataLibraryTag = XmlTag<QString,&empty, &dataLibraryTag>;
const GrammarTag grammar;
const DefineTag define;
const StartTag start;
const OptionalTag optional;
const DataLibraryTag dataLibrary;
struct RelaxNGDocument {
};
struct GrammarType {
using Tag = GrammarTag;
using allowedAttributes = std::tuple<rng::DataLibraryTag>;
};
struct DefineType {
using Tag = DefineTag;
using allowedAttributes = std::tuple<>;
};
struct StartType {
using Tag = StartTag;
using allowedAttributes = std::tuple<>;
};
}
const rng::DataLibraryTag dataLibrary;
template <>
struct allowed_child_types<rng::RelaxNGDocument> {
using types = std::tuple<rng::GrammarType>;
};
template <>
struct allowed_child_types<rng::GrammarType> {
using types = std::tuple<rng::DefineType, rng::StartType>;
};
#endif // RELAXNG_H