Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > DTD won't parse, don't understand the error messages

Reply
Thread Tools

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

 
 
Simon Brooke
Guest
Posts: n/a
 
      06-20-2010
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:28arse 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!

--

;; Semper in faecibus sumus, sole profundam variat

 
Reply With Quote
 
 
 
 
Stanimir Stamenkov
Guest
Posts: n/a
 
      06-20-2010
20 Jun 2010 14:53:22 GMT, /Simon Brooke/:

> Xerces says 'http://bowyer.journeyman.cc/adl/stable/adl/schemas/
> adl-1.4.dtd:483:28arse 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

--
Stanimir
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XML file from one DTD to another DTD test Java 2 07-28-2006 08:48 PM
Read all of this to understand how it works. then check around on otherRead all of this to understand how it works. then check around on other thelisa martin Computer Support 2 08-18-2005 06:40 AM
How to specify DTD to DTD.getDTD for DocumentParser? Ronald Fischer Java 4 03-17-2005 09:37 AM
Removing the dtd name when using print(...) on the dtd generated class Joseph Tilian Java 0 12-21-2004 02:58 PM
Including a dtd into another dtd... possible? Asfand Yar Qazi XML 1 09-19-2003 12:10 PM



Advertisments