[JDEV] First cut at a DTD
Michael T. Nygard
nygard at earthlink.net
Mon Apr 19 23:27:43 CDT 1999
Well, here's a target. Open season!
Client to server only. This DTD is sufficient to validate the "client2server.txt" file from jabber.org.
Particular issues:
Is "nick" required for a login packet, or optional?
Which, if any, fields in a message packet are required? Right now, this shows only "to" and "say" as required.
Notice how many elements have #PCDATA for content and no attributes. This usually indicates that the DTD cannot capture complete knowledge about the data. (Typically resulting in extra work for the XML application.) For instance, my instinct tells me that there are only certain allowed values for "icon" tags. This might better be captured as
<!ENTITY %iconTypes "(online|away|happy|sad|hungry)">
<!ELEMENT icon EMPTY>
<!ATTLIST icon
type %iconTypes #REQUIRED
>
This would require the icon type to be one of those in the list. (Priorities might be another good example of this.)
Is a "say" required for a status packet? (Currently shows as required.)
Can a roster packet include multiple "get" elements? Can they be mixed with multiple "del" and "add" elements?
jabber.dtd
----------Cut here-----------
<?xml version="1.0" encoding="UTF-8"?>
<!ENTITY % knownProtocolVersions "19990324">
<!ENTITY % currentProtocolVersion "19990324">
<!ELEMENT jabber (login|message|status|roster)*>
<!ATTLIST jabber
version CDATA #REQUIRED
protocol (%knownProtocolVersions;) "%currentProtocolVersion;"
>
<!ELEMENT login (user, pass, (nick)?)>
<!ATTLIST login >
<!ELEMENT user (#PCDATA)>
<!ATTLIST user >
<!ELEMENT pass (#PCDATA)>
<!ATTLIST pass >
<!ELEMENT nick (#PCDATA)>
<!ATTLIST nick >
<!ELEMENT message ((to)+, (thread)?, (priority)?, (subject)?, say)>
<!ATTLIST message >
<!ELEMENT to (#PCDATA)>
<!ATTLIST to
name CDATA #IMPLIED
>
<!ELEMENT thread (#PCDATA)>
<!ATTLIST thread >
<!ELEMENT priority (#PCDATA)>
<!ATTLIST priority >
<!ELEMENT subject (#PCDATA)>
<!ATTLIST subject >
<!ELEMENT say (#PCDATA)>
<!ATTLIST say
type CDATA #IMPLIED
>
<!ELEMENT status (say, (priority)?, (icon)?)>
<!ATTLIST status >
<!ELEMENT icon (#PCDATA)>
<!ATTLIST icon >
<!ELEMENT roster ((add)*, (del)*, (get)*)>
<!ATTLIST roster >
<!ELEMENT add (#PCDATA)>
<!ATTLIST add
group CDATA #REQUIRED
>
<!ELEMENT del (#PCDATA)>
<!ATTLIST del
group CDATA #REQUIRED
>
<!ELEMENT get (#PCDATA)>
<!ATTLIST get
group CDATA #REQUIRED
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.jabber.org/jdev/attachments/19990419/5da2e39f/attachment-0002.htm>
More information about the JDev
mailing list