Home > Blockchain >  XML DTD error AttValue: " or ' expected but validator finds no errors
XML DTD error AttValue: " or ' expected but validator finds no errors

Time:04-04

I get the error: error on line 29 at column 33: AttValue: " or ' expected When I use any browser I recieve this error. However, two validators I use don't find any issues. The line of code it is referring to:

<!ELEMENT tune (#PCDATA)>

I find it odd as there is no code in column 33 as the code ends at column 29.

Here is the entire code:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE bands [
    <!NOTATION JPG SYSTEM "image/jpeg">
    <!ENTITY celtic SYSTEM "celtic.jpg" NDATA JPG>
    <!ENTITY badger SYSTEM "badger.jpg" NDATA JPG>
    <!ELEMENT bands (band)>
    <!ELEMENT band (name, city, logo?, competition)>
    <!ATTLIST band cid ID #REQUIRED>

    <!ELEMENT name (#PCDATA)>
    <!ATTLIST name grade (1|2|3|4|5|juvenile|novice) #REQUIRED>
    <!ELEMENT city (#PCDATA)>
    <!ELEMENT logo EMPTY>
    <!ATTLIST logo source ENTITY #REQUIRED>
    <!ELEMENT competition (event, event)>
    <!ELEMENT event (tune)>
    <!ATTLIST event type ENTITY (MSR | Medley) #REQUIRED>
    <!ELEMENT tune (#PCDATA)>
]>
<bands>
   <band cid="c0001">
      <name grade="juvenile">School of Celtic Bagpipes &amp; Drumming</name>
      <city>Delafield</city>
      <logo source="celtic" />
      <competition>
         <event type="MSR">
            <tune>Charlies Welcome</tune>
            <tune>Mrs MacPherson of Inveran</tune>
            <tune>Brown Haired Maiden</tune>
         </event>
         <event type="Medley">
            <tune>Rowd's Hornpipe</tune>
         </event>
      </competition>
   </band>
   <band cid="c0002">
      <name grade="juvenile">Badger Pipes and Drums</name>
      <city>Madison</city>
      <logo source="badger" />
      <competition>
         <event type="MSR">
            <tune>Lord Alexander Kennedy</tune>
            <tune>Bob of Fettercairn</tune>
            <tune>Brown Haired Maiden</tune>
         </event>
         <event type="Medley">
            <tune>Out of the Air</tune>
         </event>
      </competition>
   </band>
   <band cid="c0003">
      <name grade="novice">Pardeeville School of Piping and Drumming</name>
      <city>Pardeeville</city>
      <competition>
         <event type="MSR">
            <tune>Lord Alexander Kennedy</tune>
            <tune>Bob of Fettercairn</tune>
            <tune>The Little Cascade</tune>
         </event>
         <event type="Medley">
            <tune>The Radar Racketeer</tune>
         </event>
      </competition>
   </band>
   <band cid="c0004">
      <name grade="3">Zoar Scottish Pipe Band</name>
      <city>Zoar</city>
      <competition>
         <event type="MSR">
            <tune>Charlies Welcome</tune>
            <tune>Mrs MacPherson of Inveran</tune>
            <tune>Major Manson</tune>
         </event>
         <event type="Medley">
            <tune>Miss Lily</tune>
         </event>
      </competition>
   </band>
   <band cid="c0005">
      <name grade="juvenile">Stockholm Pipe Band</name>
      <city>Stockholm</city>
      <competition>
         <event type="MSR">
            <tune>Pretty Marion</tune>
            <tune>The Sheepwife</tune>
            <tune>Brown Haired Maiden</tune>
         </event>
         <event type="Medley">
            <tune>Farewell to Erin</tune>
          </event>
      </competition>
   </band>
</bands>

CodePudding user response:

I think the problem is actually this line:

<!ATTLIST event type ENTITY (MSR | Medley) #REQUIRED>

You can't use ENTITY and also an enumeration of possible values. (See here.)

You probably want:

<!ATTLIST event type (MSR | Medley) #REQUIRED>

There are also a couple of other issues...

  1. Your XML has multiple band child elements of bands, but the content model only allows one band. You probably want to add the occurrence indicator:
<!ELEMENT bands (band )>
  1. Your XML has multiple tune child elements of event, but the content model only allows one tune. You probably want to add the occurrence indicator:
<!ELEMENT event (tune )>
  • Related