Ethereal-dev: [Ethereal-dev] XML dissector / DTDs

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Martin Mathieson <martin.mathieson@xxxxxxxxxxxx>
Date: Thu, 04 May 2006 17:29:05 +0100
Hi,

I've been playing with the XML dissector, adding a new DTD for application/reginfo+xml (RFC 3680) as shown below. It is already useful that I can now filter on the presence of a particular field and its value, but I was hoping that I would get some indication when frames don't match the DTD description.

I'm using a colouring rule with the filter (xml.tag or xml.attribute or xml.doctype) to show frames that have elements not described in the schema in an alarming red colour, but can't tell if mandatory elements or attributes are missing or something appears too often, etc.... (I did try to constrain the values of attributes, e.g. reginfo.state has to be "full" or "partial", but this isn't included below as it had no effect). Am I missing something?

Regards,
Martin



<? ethereal:protocol
  proto_name="reginfo"
  description="Reginfo XML doc (RFC 3680)"
  hierarchy="yes" ?>

<!--
-->

<!DOCTYPE reginfo
[

<!ATTLIST reginfo xmlns CDATA #REQUIRED
                 version CDATA #REQUIRED
                 state CDATA #REQUIRED>

<!ELEMENT uri (#PCDATA)>

<!ELEMENT display-name (#PCDATA)>
<!ATTLIST display-name  lang CDATA #IMPLIED>

<!ELEMENT unknown-param (#PCDATA)>

<!ELEMENT contact (uri | display-name | unknown-param)* >
<!ATTLIST contact      id CDATA #REQUIRED
                      state CDATA #REQUIRED
                      event CDATA #REQUIRED
                      expires CDATA #IMPLIED
                      retry-after CDATA #IMPLIED
                      duration-registered CDATA #IMPLIED
                      q CDATA #IMPLIED
                      cseq CDATA #IMPLIED
                      callid CDATA #IMPLIED>


<!ELEMENT registration (contact)*>
<!ATTLIST registration aor CDATA #REQUIRED
                      id CDATA #REQUIRED
                      state CDATA #REQUIRED>
]>