[JDEV] Java XML Parsers

Daniel Veillard veillard at redhat.com
Sun Dec 30 07:03:13 CST 2001

On Sun, Dec 30, 2001 at 12:03:06PM +0000, Al Sutton wrote:
> Daniel,


> I think you may be a little confused. I think you'll find that there are

  Sorry, no, I don't think I am.

> specs for SAX and DOM parsers for XML, but XML itself is (or at least
> was originally) purely a data representation format, and as such didn't

  Right but the spec includes a lot of points that an XML parser MUST
respect to be considered to be conformant to XML. Your code clearly is not
and you should not advocate using it as an XML parser. Call it "markup
parser" if you want but not XML parser because this is not.

> I fully accept it doesn't support processing directives (such as the
> <?xml element which is used to detail encoding), and that enforcing all

  Which is an absolute requirement for an XML parser. How many time did
you see messages on this list "the server disconnect because I use
non ASCII characters" like messages ? A server based on your parser would
not have the same behaviour as the common jabberd using expat.

> tags are pushed into lower case isn't ideal (and is something that is

It's just plain broken, sorry. The Jabber protocol is expected to be extensible
and the extensions are driven by XML (c.f. the XML-RPC, XHTML, ones etc...),
and all those are case sensitive because they are XML.

> Myself and others have used my parser in a number of products which
> handle the jabber protocol and thought it may be of use to Matt.

It happen to work, to some extent. Your parser though will not generate
the same output as something based on expat or another XML parser (seem you
miss the CR/LF normalization which mean you will not pass the same data
as a conformant parser for some multiline messages for example).

It's nothing personal, just one should respects the specifications when
they happen to exist and use conformant code/products when they
are available.


Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard at redhat.com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

More information about the JDev mailing list