Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: [Wireshark-dev] [Patch] to fix DTD parsing problem

From: Martin Mathieson <martin.mathieson@xxxxxxxxxxxx>
Date: Wed, 26 Jul 2006 10:57:55 +0100
Hi,

I'm seeing these errors:

"../tshark -G fields | /usr/bin/perl ./dfilter2pod.pl ./wireshark-filter.pod.template > wireshark-filter.pod tshark: Dtd Parser in file /usr/local/share/wireshark/dtds/reginfo.dtd: syntax error in reginfo.dtd:22 at or before 'CDATA':
DTD parsing failure
syntax error at end of fileDTD parsing failure

tshark: Dtd Parser in file /usr/local/share/wireshark/dtds/smil.dtd: syntax error in smil.dtd:76 at or before ')':
DTD parsing failure
syntax error at end of fileDTD parsing failure"

at the end of my builds, and also popping up in dialogs at start-up.

This error has been present since http://www.wireshark.org/lists/wireshark-commits/200607/msg00150.html, which changed this line:

name           [A-Za-z][-a-z0-9_][-a-zA-Z0-9_]*

to allow names to begin with a capital letter.  The previous line was:

name           [a-z][-a-zA-Z0-9_]*

The error reported in reginfo.dtd seems to be related to not allowing single-character attribute names, i.e. it stops complaining about that file if I change 'q' to 'qq'. I'm not sure about the smil.dtd problem, but this patch which sets the line instead to:

name           [A-Za-z][-a-z0-9_]*[-a-zA-Z0-9_]*

seems to fix the problem (I know absolutely nothing about lex syntax, but this looks reasonable to me and seems to work).

Best regards,
Martin
Index: epan/dtd_parse.l
===================================================================
--- epan/dtd_parse.l	(revision 18794)
+++ epan/dtd_parse.l	(working copy)
@@ -147,7 +147,7 @@
 pipe           "|"
 dquote         ["]
 
-name           [A-Za-z][-a-z0-9_][-a-zA-Z0-9_]*
+name           [A-Za-z][-a-z0-9_]*[-a-zA-Z0-9_]*
 dquoted        ["][^\"]*["]
 squoted        ['][^\']*[']