Reviewlet of XML Processing With Python by S.McGrath

Mike F Miller mikem at ichips.intel.com
Tue Sep 19 14:34:50 EDT 2000


Sean Mc Grath wrote:
> Please forward an example. I use comments in DTDs with
> XMLV without problems. Send over an example and I will
> take a look.

Ah, the problem wasn't exactly what I though. I was using the
xfs example (files 13001.txt and 13002.txt on the CD) and when
I ran xmlv on them, they wouldn't parse, but the problem wasn't
with the comments, it was with the fact that the entity
declarations in the DTD are missing the '!ENTITY' string, so
the DTD should actually look like:

   -----------------------cut here----------------------------
<!--
A simple DTD for filesystem information

A filesystem consists of a root xfs element that can contain
files and/or other directories.

Both directories and files have names and modification
dates.

Files have an associated size in bytes
-->

<!-- Root element type -->
<!ELEMENT xfs (pattern,(dir|file)*)>

<!-- The wildcard pattern used to create the filesystem listing -->
<!ELEMENT pattern (#PCDATA)>

<!-- A directory has a name, a modification time and 0 or more of
either files or directories -->
<!ELEMENT dir (name,mod,(dir|file)*)>

<!-- A file has a name, a size and a modification time -->
<!ELEMENT file (name,size,mod)>

<!-- a directory or file name -->
<!ELEMENT name (#PCDATA)>

<!-- A file size in bytes -->
<!ELEMENT size (#PCDATA)>

<!-- a date e.g. Sat Jun 12 16:22:02 1999 --> 
<!ELEMENT mod (#PCDATA)>
   ---------------------cut here---------------------------

Which does work with xmlv just fine. I just wasn't reading the error
messages closly enough, so I got confused about what the real problem
was since I had errors from different sources (like trying to use
<![CDATA[ ]]> in a DTD). In various things I was trying. I think I've
got a good handle on it now.

Thanks!

 - Mike Miller  "Save the whales. Feed the hungry. Free the mallocs."
   mikem at ichips.intel.com     0x2A    http://members.xoom.com/Mikem42



More information about the Python-list mailing list