[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [JDEV] First cut at a DTD



New version attached.  Revised per comments.

> Looks very nice!  Thanks, I've been wanting something like that for some
> time but I just can't figure out the strange syntax and can't find the
> spec defining it(EBNF or something ;-)

The DTD syntax is defined directly in the XML 1.0 spec at
http://www.w3.org/TR/1998/REC-xml-19980210.html.  Unfortunately, the spec
mixes DTD parts with XML parts pretty thoroughly.  I haven't seen a great
reference for just the DTD syntax parts.

> As far as I understand it though, with reguard to XML and DTDs, they are
> really most useful in special applications requiring "pure" strict data
> and in XML editors providing the user rules when composing a document,
> right?

This is true.

> With how the server is designed, they wouldn't work at all by defualt,
> since the server is as future-proof as I can make it.  It allows
> _anything_ for the XML, and only extracts what it needs from the parsed
> XML, ignoring the rest.  This way the protocol can grow and adapt and not
> disturb the old servers installed, they might just miss out on a few newer
> features. Adding a strict DTD check into the server would pretty much put
> an end to that, but it might be very useful for a client.  Actually, it
> might be an excellent option for testing minimal adherence to the spec
> from clients and servers, or as a debugging option on the server for the
> paranoid :)

Well, I agree with this to an extent.  It is possible to create a DTD that
is future-proof.  It allows for future extension with parameter entities,
conditional sections, internal subsets, and the like.   Of course, just like
reusable code vs. one-shot code, there is an order of magnitude more
complexity to doing this.  Since validation won't be part of processing each
packet, and this DTD is more for documentation purposes, the added
complexity is probably not worth it.

> I really do like having the DTD though, it provides a clear and automated
> understanding of the protocol, it's the definition of the protocol.

That is my intent.

> Thanks!

You're welcome!

Cheers,
-Mike Nygard

jabber.dtd