File: README.txt

package info (click to toggle)
libexml-java 0.0.20080703-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 4,064 kB
  • ctags: 2,978
  • sloc: java: 20,418; xml: 3,171; perl: 36; sh: 11; makefile: 11
file content (72 lines) | stat: -rw-r--r-- 2,627 bytes parent folder | download | duplicates (2)
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

	      E-XML Library:  For XML, XML-RPC, HTTP, and related.
			 Copyright (C) 2002  Elias Ross

genman@maison-otaku.net
http://maison-otaku.net/~genman


				  WHAT IS IT?

This library is a collection of tools for parsing XML.  For better or worse,
DOM and SAX are fairly heavy-weight and cumbersome parsing tools, which have
lead others to create libraries such as JDOM and KXML (Enhydra).  For most
of you, the Xerces library will be just fine, and I suggest you stick with
that if performance is not a big problem.


			       PARSE PERFORMANCE

XML parsing is pretty damn inefficient, at least when you're parsing
hundreds of XML messages a second.  Take a look at XMLSParser.  It
is a XML pull-parser (look that up on Google) which makes it very
cheap in terms of object creation overhead.

Most of the pull-parsers don't support String pools or allow for
re-using existing objects.  Most small-footprint parsers have lousy
performance, often much worse than Xerces SAX and DOM.

If you test this library's performance against Xerces DOM, it's comparable 
(perhaps a little faster) for reading a whole document.

For the ultimate in parse speed, use XmlSParser.


				 STREAMING XML

Another problem is handling streaming protocol data, which can't be
gracefully done with SAX, and cannot be done with any DOM parsers.
An XML pull-parser makes it fairly simple to write efficient protocol
handling routines.  However, the XML pull-parsers I've seen are fairly
cumbersome as well, maybe because they were designed for low-memory
devices.

The XmlParser class lets you parse streaming data in a straight-forward
manner.  XmlSParser is a little more complicated to use, and does not
support DTD validation.


				    XML-RPC

I include an XML-RPC implementation which streams XML data over HTTP.
It doesn't do any fancy object marshalling or demarshalling, but you can
follow my example package and implement your own streaming conversion routines.


			  RELATED TOOLS AND LIBRARIES

The java.net.URLConnection library is not very good at sending streaming data,
so I had to write my own HTTP library.  It's not exactly user-friendly, but it
is better than any other library I've seen so far.  You will have to write
your own "smart" HttpClient if you want to do more than what I wrote there.


			   EXAMPLES AND DOCUMENTATION

First, create the Java-Docs.  Take a look at the "src-test" directory, which
demonstrates every method in the library.  Since this is open-source, you
of course have access to the source code.  Please send me e-mail if you
have a suggestion.

I will eventually add in example programs later.