At 2004-01-23 13:44 +0000, james walker wrote:
>I have this dtd below:
><!ELEMENT chapter (section+)>
>when i try to validate this dtd th eparser complains about "Cannot have a
>DTD declaration outside of a DTD." an dit points to the "chapter" name in th
Right ... most tools will not allow you to validate just a set of declarations.
>I tried adding "<!doctype chapter" around th ewhole dtd file
>and a secon error appeared saying "XML document must have a top level
Right again ... an XML document isn't an XML document without an instance
>does anyone know why this is happening
There is no formal definition for "just a set of declarations" as
declarations are only officially found in or referenced by XML documents
and XML documents need to have an instance portion.
>and what i can do to solve it?
If you want to validate only a set of DTD declarations, find a tool that
does this. Most of them don't have this feature, but the
publicly-available Multi-Schema Validator from Sun Microsystems happens to
do just this:
I haven't bothered looking for any other tool as I use this for a lot of my
document model validation (DTD, XSD, ISO 19757-2 (RELAX-NG), etc). I also
use Jing for ISO 19757-2 RELAX-NG and RELAX-NG Compact Syntax.
An example is below where I've wrapped the Java invocation of MSV in a
small batch file.
I hope this helps.
<!ELEMENT doc EMPTY >
No validation errors.
<!ELEMENT doc EMPTY
start parsing a grammar.
Premature end of parameter entity "%(null);"
failed to load a grammar.
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