forked from mpw/Objective-XML
/
Concepts.rtf
99 lines (88 loc) · 3.88 KB
/
Concepts.rtf
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
{\rtf1\mac\ansicpg10000{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
\f0\b\fs48 \cf0 \
MPWXmlKit Overview\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
\b0\fs28 \cf0 Marcel Weiher\
Metaobject GmbH
\fs48 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
\fs24 \cf0 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
\b \cf0 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
\b0 \cf0 \
\
This is an overview over the concepts and services provided by the framework MPWXmlKit, which is intended to provide various XML-related services including but not limited to parsing and generation of XML documents.\
\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
\b \cf0 Services
\b0 \
\
The primary services provided are XML parsing and generation, with bot a SAX-like parser and a parser that generates a DOM-like structure. Built on top of these are an Apple property-list parser and generator as well as an XML archiver/unarchiver.\
\
Possible future extensions include support for transformation + navigation using XSLT, XPath, XPath etc. Parsers for specific XML-based formats will probably not be added to the kit but built on top of it.\
\
\
\b Goals
\b0 \
\
- Suitable not just for applications but also for XML-processors\
- Suitable for partial processing of documents\
- 100% bit-fidelity to original document possible\
- Highest possible performance, with a "pay as you go" policy:\
- you only pay a cost in performance if you actually use a feature\
- Simple, fully OO interfaces\
\
In order to achieve these goals, full conformance to the XML specification has been sacrificed where necessary. For example, XML-parsers are required to to resolve entity references, which makes reconstructing the exact original input difficult to impossible.\
\
\b Design Overview
\b0 \
\
Seen from the bottom up, MPWXmlScanner turns XML-characters into messages sent to self delimiting specific regions of interest within the XML-data using straight C pointers. At the next higher level, the MPWXmlParser subclass of MPWXmlScanner turns these call-backs into SAX-style messages (sent to a delegate) with real objects for the top-level syntactic entities (roughly: tags, data) and checks for proper tag-nesting.\
\
The specific parsers (DOM, plist, archiver) provided here act as their own delegates, but this need not be the case, parser-delegates can just as well be different objects. \
\
\b Implementation Notes
\b0 \
\
Object-caches are used extensively so real objects can be used in all high-level interfaces without sacrifcing performance. The same idea applies to the extensive use of IMP caching and messaging. \
\
\b Issues/Caveats
\b0 \
\
-Currently, only scans/parses a single piece of data, support for stream-data sources is being considered but there are still issues to resolve.\
-Whitespace detection is presently disabled. \
-Entity-references are not handled (only detected).\
-Literal '>' characters in attributes are not currently supported, but theoretically allowed by the XML specificaton.\
- Parsers are MPWStreams, the parsed data has to be retrieved from the NSMutableArray that is their default target\
- virtually no automated tests in place\
- the unique-string generation used (from MPWFoundation) could be faster\
\
\b Class Hierarchy
\b0 \
\
Protocols\
\
SaxDocumentHandler\
\
Classes\
\
XML-Scanner\
XML-Parser (SAX-like)\
DOM-Parser\
XML Apple Plist-parser\
XML-based unarchiver\
XML-Generator\
XML Plist generator\
Apple XML Plist generator\
(NSCoder + coding additions)\
XML Archiver\
\
Various support classes\
\
\
\
\
}