DTD parsing error
David Abrahams <[email protected]> Sun, 18 Jul 2004 17:40:16 -0400
| Newsgroups | gmane.emacs.psgml.user |
|---|---|
| Message-ID | <[email protected]> |
PSGML gives the following errors for the enclosed DTD. I'm pretty certain PSGML is wrong, though. Any hints? TIA c:/cygwin/home/dave/dtd/cb2e.dtd line 157 col 71 - line 0 col 0 entity RECIPE c:/tmp/boost_recipe.xml line 2 col 8 Delimiter COM (--) expected; at: > <!ELEMENT ---- -- Dave Abrahams Boost Consulting http://www.boost-consulting.com
cb2e.dtd
(text/dtd, 7 KB)
<!-- each document' root element is 'chapter': intro, then 1+ recipes -->
<!ELEMENT chapter (title, intro, recipe+) >
<!-- each chapter is about a language, by default Python, and a subject -->
<!ATTLIST chapter cnum CDATA #REQUIRED lang CDATA "Python" chap ID #REQUIRED >
<!-- inline-tags entity, includes tags which are refs to see-also -->
<!ENTITY % inliner "c|h|i|l|r|f|q|o|seebook|seeref|seeperl|seepap|seeurl|seechap" >
<!-- the intro has credits (not for print!), text, author, affiliation -->
<!ELEMENT intro (intro_credits, intro_text, see_also?,
intro_author, intro_author_affiliation) >
<!-- intro_credits give intro-author's name and email (neither is for print) -->
<!ELEMENT intro_credits (#PCDATA) >
<!ATTLIST intro_credits mail CDATA #REQUIRED >
<!-- an introduction's text is structured into paragraphs/heads/dl's/quotes/faq's -->
<!ELEMENT intro_text (head|p|dl|quote|faq)+ >
<!-- intro_author identifies intro-author's name and optionally honorifics -->
<!ELEMENT intro_author (#PCDATA) >
<!-- intro_author_affiliation identifies intro-author's affiliation -->
<!ELEMENT intro_author_affiliation (#PCDATA) >
<!-- recipe is the main child-element, and the most highly structured -->
<!ELEMENT recipe (title, recipe_credits, editor_comments,
problem, solution, discuss, see_also?) >
<!-- each recipe has a 'ref' ID (same as on the web & in pickle files) -->
<!-- plus a progressive number for the recipe within its chapter -->
<!ATTLIST recipe num CDATA #REQUIRED ref ID #REQUIRED >
<!-- recipe-title is typical inline mixed-contents -->
<!ELEMENT title (#PCDATA | %inliner;)* >
<!-- problem-statement is typical inline mixed-contents -->
<!ELEMENT problem (#PCDATA | %inliner;)* >
<!-- solution is a sequence of paragraphs, basically like discuss -->
<!ELEMENT solution (p)+ >
<!-- discussion-text is strictly structured into 1+ paragraphs/heads/dl's -->
<!ELEMENT discuss (head|p|dl)+ >
<!-- editor comments for internal use, NOT meant to appear in the book! -->
<!ELEMENT editor_comments ANY >
<!-- recipe-credits list 1+ contributors to the recipe -->
<!ELEMENT recipe_credits (credit+) >
<!-- credit identifies authors and contributors; mail is NOT for print -->
<!ELEMENT credit (#PCDATA) >
<!ATTLIST credit mail CDATA #REQUIRED >
<!-- pre is code or other line-oriented stuff, may have inline-markup -->
<!ELEMENT pre (#PCDATA | %inliner;)* >
<!ATTLIST pre kind (CODE|OUTPUT|TEXT) "CODE" >
<!-- p is paragraph-element structuring general-text, general-text itself -->
<!ELEMENT p (#PCDATA | pre|ol | %inliner;)* >
<!-- head is for a header among paragraphs-divided text -->
<!ELEMENT head (#PCDATA | %inliner;)* >
<!-- tags for inline markup (code, highlight, literal, input, replaceable) -->
<!ELEMENT c (#PCDATA) >
<!ELEMENT h (#PCDATA) >
<!ELEMENT l (#PCDATA) >
<!ELEMENT i (#PCDATA) >
<!ELEMENT r (#PCDATA) >
<!-- and one more inline markup tag, this one for filenames and directories -->
<!ELEMENT f (#PCDATA) >
<!-- and one for "text within quote marks" (inline, too) -->
<!ELEMENT q (#PCDATA) >
<!-- and one for "example program output" (inline, too) -->
<!ELEMENT o (#PCDATA) >
<!-- ordered-list is structured into list-items -->
<!ELEMENT ol (li+) >
<!-- each list-item is typical mixed-content -->
<!ELEMENT li (#PCDATA | pre | %inliner;)* >
<!-- definition-list is structured into terms and definitions -->
<!ELEMENT dl (dt, dd)+ >
<!-- definition-term is just text -->
<!ELEMENT dt (#PCDATA) >
<!-- definition is typical mixed-content -->
<!ELEMENT dd (#PCDATA | %inliner;)* >
<!-- quote is structured into quote_text and quote_reference -->
<!ELEMENT quote (quote_text, quote_reference) >
<!-- quote text is typical mixed-content -->
<!ELEMENT quote_text (#PCDATA | %inliner;)* >
<!-- quote reference is typical mixed-content -->
<!ELEMENT quote_reference (#PCDATA | %inliner;)* >
<!-- faq is structured into questions and answers -->
<!ELEMENT faq (question, answer)+ >
<!-- question is typical mixed-content -->
<!ELEMENT question (#PCDATA | %inliner;)* >
<!-- answer is structured into paragraphs -->
<!ELEMENT answer (p)+ >
<!-- tags for see-also and see-* references inside general/inline text -->
<!-- see-also section, may be empty or have seealsoish-tags -->
<!ELEMENT see_also (p | perl | paper | ref | refoc | url | book)* >
<!-- NOTE that each item in a see_also goes on a SEPARATE line!!! -->
<!-- reference to a book in see-also is internally structured -->
<!ELEMENT book (book_author, book_title, book_year, book_publisher, book_isbn) >
<!-- book is identified, for use in seebook tags in general text -->
<!ATTLIST book b ID #REQUIRED>
<!ELEMENT book_author (#PCDATA) >
<!ELEMENT book_title (#PCDATA) >
<!ELEMENT book_year (#PCDATA) >
<!ELEMENT book_publisher (#PCDATA) >
<!ELEMENT book_isbn (#PCDATA) >
<!-- see-book tag in general or inline text points to a book tag via ID -->
<!ELEMENT seebook EMPTY >
<!ATTLIST seebook b IDREF #REQUIRED >
<!-- reference to other recipe in see-also points to other recipe by ID -->
<!-- tag ref is for other recipe within the same chapter (document) -->
<!ELEMENT ref EMPTY >
<!ATTLIST ref r IDREF #REQUIRED cnum CDATA #REQUIRED num CDATA #REQUIRED >
<!-- the cnum and num attributes redundantly give chapter-number, and
recipe number within chapter, for the ref'd-to recipe; the same
redundancy is in refoc, seeref, perl, and seeperl -->
<!-- tag refoc is for other recipe in some other chapter (document) -->
<!ELEMENT refoc EMPTY >
<!ATTLIST refoc r ID #REQUIRED cnum CDATA #REQUIRED num CDATA #REQUIRED >
<!-- the cnum and num attributes redundantly give chapter-number, and
recipe number within chapter, for the ref'd-to recipe -->
<!-- see-other-recipe tag in gen or inline text points via ID too -->
<!-- it can point to recipe in this chap, or refoc in this recipe's see-also -->
<!ELEMENT seeref EMPTY >
<!ATTLIST seeref r IDREF #REQUIRED cnum CDATA #REQUIRED num CDATA #REQUIRED >
<!-- see-perl-CB tag in see-also section uses p+chapter_recipe as ID -->
<!ELEMENT perl EMPTY >
<!ATTLIST perl p ID #REQUIRED cnum CDATA #REQUIRED num CDATA #REQUIRED >
<!-- see-perl-CB in general/inline text also uses p+chapter_recipe -->
<!ELEMENT seeperl EMPTY >
<!ATTLIST seeperl p IDREF #REQUIRED cnum CDATA #REQUIRED num CDATA #REQUIRED >
<!-- reference to a paper in see-also is internally structured -->
<!ELEMENT paper (paper_author, paper_title, paper_venue, paper_url) >
<!-- paper is identified, for use in seepaper tags in general text -->
<!ATTLIST paper p ID #REQUIRED >
<!ELEMENT paper_author (#PCDATA) >
<!ELEMENT paper_title (#PCDATA) >
<!ELEMENT paper_venue (#PCDATA) >
<!ELEMENT paper_url (#PCDATA) >
<!-- see-paper tag in general or inline text points to a paper tag via ID -->
<!ELEMENT seepap EMPTY >
<!ATTLIST seepap p IDREF #REQUIRED >
<!-- reference to URL in see-also gives the URL itself as attribute -->
<!ELEMENT url EMPTY >
<!ATTLIST url u CDATA #REQUIRED >
<!-- see-url tag in general/inline text also gives the URL (defect?) -->
<!ELEMENT seeurl EMPTY >
<!ATTLIST seeurl u CDATA #REQUIRED >
<!-- reference to "a whole other chapter", typically within an intro -->
<!ELEMENT seechap EMPTY >
<!ATTLIST seechap c CDATA #REQUIRED >