DTD won't parse, don't understand the error messages

S

Simon Brooke

I have (obviously) an error in my DTD. Different parsers give me
different error messages, but none of them help me understand the problem
or how to fix it.

sgmls says 'onsgmls:<URL>http://bowyer.journeyman.cc/adl/stable/adl/
schemas/adl-1.4.dtd:483:27:E: "canonical" is not a reserved name'

Xerces says 'http://bowyer.journeyman.cc/adl/stable/adl/schemas/
adl-1.4.dtd:483:28:parse Error: the attribute type is required in the
declaration of the attribute "sequence" for the element "order".

What's actually there at 483 is:

<!ELEMENT order (documentation?)>
<!ATTLIST order
property CDATA #REQUIRED
sequence %Sequences; #IMPLIED>

where Sequences is defined at line 174 as

<!-- sequences for orderings of lists - see entity 'order'
canonical: Whatever the normal canonical ordering for this
datatype is -
typically alpha-numeric, except for dates, etc.
reverse-canonical: The reverse of the above

possibly there should be some further values but I have no idea what
these are
-->
<!ENTITY % Sequences "canonical|reverse-canonical">

Ideally I'd like not only to know how to fix it, but to understand why
it's wrong in order that I don't make the same mistake again.

Thanks!
 
S

Stanimir Stamenkov

20 Jun 2010 14:53:22 GMT, /Simon Brooke/:
Xerces says 'http://bowyer.journeyman.cc/adl/stable/adl/schemas/
adl-1.4.dtd:483:28:parse Error: the attribute type is required in the
declaration of the attribute "sequence" for the element "order".

What's actually there at 483 is:

<!ELEMENT order (documentation?)>
<!ATTLIST order
property CDATA #REQUIRED
sequence %Sequences; #IMPLIED>

where Sequences is defined at line 174 as

<!ENTITY % Sequences "canonical|reverse-canonical">

Ideally I'd like not only to know how to fix it, but to understand why
it's wrong in order that I don't make the same mistake again.

Obviously you're missing the parentheses around the enumeration [1].
You could either put them in the ATTLIST declaration:

<!ATTLIST order
property CDATA #REQUIRED
sequence (%Sequences;) #IMPLIED>

or in the ENTITY one:

<!ENTITY % Sequences "(canonical|reverse-canonical)">

depending on how you plan to use the %Sequences; entity.

[1] http://www.w3.org/TR/xml/#dt-enumerated
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,821
Messages
2,569,748
Members
45,726
Latest member
RaleighAll

Latest Threads

Top