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

Discussion in 'XML' started by Simon Brooke, Jun 20, 2010.

  1. Simon Brooke

    Simon Brooke Guest

    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!

    --

    ;; Semper in faecibus sumus, sole profundam variat
    Simon Brooke, Jun 20, 2010
    #1
    1. Advertising

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

    --
    Stanimir
    Stanimir Stamenkov, Jun 20, 2010
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. simon

    Error message I don't understand

    simon, Dec 5, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    315
    Hatim R
    Dec 5, 2003
  2. Joseph Tilian
    Replies:
    0
    Views:
    351
    Joseph Tilian
    Dec 21, 2004
  3. Ronald Fischer
    Replies:
    4
    Views:
    1,758
    Ronald Fischer
    Mar 17, 2005
  4. test
    Replies:
    2
    Views:
    2,029
    Oliver Wong
    Jul 28, 2006
  5. Tom Cloyd
    Replies:
    1
    Views:
    86
    Brian Candler
    Sep 19, 2008
Loading...

Share This Page