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

Simon Brooke

Usenet Archive
Joined
Feb 3, 2000
Messages
488
Reaction score
0
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!
 

Stanimir Stamenkov

Usenet Archive
Joined
Dec 2, 2002
Messages
431
Reaction score
0
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
 

Simon Brooke

Usenet Archive
Joined
Feb 3, 2000
Messages
488
Reaction score
0
On Sun, 20 Jun 2010 18:08:23 +0300, Stanimir Stamenkov wrote:

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>
...

D'oh!

Thank you very much indeed!
 

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
548,051
Messages
3,104,251
Members
248,135
Latest member
tobystanx

Latest Threads

Top