13.1. A Simple XML DTD for Filesystem Information

We will work with the following very simple representation of filesystem information.

 CD-ROM reference=13001.txt <!__ 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 --> < xfs (pattern,(dir|file)*)> <!-- The wildcard pattern used to create the filesystem listing --> < pattern (#PCDATA)> <!-- A directory has a name, a modification time and 0 or more of either files or directories --> < dir (name,mod,(dir|file)*)> <!-- A file has a name, a size and a modification time --> < file (name,size,mod)> ...

Get XML Processing with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.