At 2004-01-29 16:09 +0000, james walker wrote:
>Great! its working fine now, thanks for the help. It shows now that i have
>no validation errors for my dtd file. Is it valid for my dtd file to just be
>a list of element declarations:
><!ELEMENT chapter (section+)>
><!ELEMENT section (objective | scope | subsection+ | migration-path |
>key-date+ | geographic | tools | support | related-material+ | additional)>
><!ELEMENT scope (applicability+ | exempt* | note*)>
><!ELEMENT subsection (requirement+)>
><!ELEMENT requirement (description | specification* | note* | table*)>
><!ELEMENT specification (#PCDATA | condition)*>
><!ELEMENT additional (process | definition | note | example | list |
><!ELEMENT table (caption, thead, tbody)>
><!ELEMENT thead (tr)>
><!ELEMENT tbody (tr)>
><!ELEMENT tr (th* | td*)>
><!ELEMENT th (#PCDATA)>
Right ... which is a feature of MSV and not standard XML.
>or does there have to be some sort of top level element wrapped around these
>elements e.g <doctype>? At the moment, it validated the dtd file above.
For a well-formed XML file the document type definition needs to be either
inside the document type declaration or referenced by the document type
Say the above set of lines was in "foo.dtd" ... you would create an XML
document "foo.xml" as follows:
<!DOCTYPE chapter SYSTEM "foo.dtd">
Then you could validate that the structure used in foo.xml meets the
constraints of the document model described by foo.dtd.
I hope this helps.
Public courses: sign up for one or both soon to reserve your seat!
Each week: Monday-Wednesday: XSLT/XPath; Thursday-Friday: XSL-FO
Washington, DC: 2004-03-15 San Francisco, CA: 2004-03-22
Hong Kong, China: 2004-05-17 Bremen, Germany: 2004-05-24
World-wide on-site corporate, government & user group XML training
G. Ken Holman mailto:[log in to unmask]
Crane Softwrights Ltd. http://www.CraneSoftwrights.com/l/
Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness http://www.CraneSoftwrights.com/l/bc