XML DTD错误AttValue:"或'预期,但验证器发现没有错误
我收到错误: 第 29 行第 33 列出现错误:AttValue:“或 ' 预期 当我使用任何浏览器时,我都会收到此错误。但是,我使用的两个验证器没有发现任何问题。 它所指的代码行:
<!ELEMENT tune (#PCDATA)>
我觉得很奇怪,因为第 33 列中没有代码,因为代码在第 29 列结束。
这是整个代码:
<?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 & 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>
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 & 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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为问题实际上是这样的行:
您不能使用
entity
以及可能的值列举。 (请参阅这里。)您可能想要:
还有一个其他几个问题...
band
bands
的子元素,但是内容模型仅允许一个band
。您可能要添加+
出现指示器:tune
event> event
的子元素,但是内容模型只允许一个TUNE
。您可能想添加+
出现指示器:I think the problem is actually this line:
You can't use
ENTITY
and also an enumeration of possible values. (See here.)You probably want:
There are also a couple of other issues...
band
child elements ofbands
, but the content model only allows oneband
. You probably want to add the+
occurrence indicator:tune
child elements ofevent
, but the content model only allows onetune
. You probably want to add the+
occurrence indicator: