XML错误:标记声明必须格式正确

时间:2019-12-16 20:45:46

标签: xml markup

[1,3]消息:文档类型声明包含或指向的标记声明必须格式正确。我该如何解决?

<?xml version="1.0" encoding="utf-8"?><!DOCTYPE nta PUBLIC '-//Uppaal Team//DTD Flat System 1.1//EN' 'http://www.it.uu.se/research/group/darts/uppaal/flat-1_1.dtd'><nta><declaration>// Place global declarations here.

chan s0, r0, rack0, sack0;</declaration><template><name x="5" y="5">Sender</name><declaration>// Place local declarations here.
</declaration><location id="id0" x="56" y="80"><name x="64" y="48">WaitAck</name></location><location id="id1" x="-16" y="0"><name x="-32" y="-32">Send</name></location><init ref="id1"/><transition><source ref="id0"/><target ref="id1"/><label kind="synchronisation" x="0" y="64">sack0?</label><nail x="-16" y="80"/></transition><transition><source ref="id1"/><target ref="id0"/><label kind="synchronisation" x="0" y="-16">s0!</label><nail x="56" y="0"/></transition></template><template><name>Medium</name><location id="id2" x="16" y="-24"><name x="6" y="-54">Forward_sack0</name></location><location id="id3" x="16" y="-80"><name x="0" y="-112">Forward_s0</name></location><location id="id4" x="-128" y="-8"><name x="-144" y="-40">Wait</name></location><init ref="id4"/><transition><source ref="id2"/><target ref="id4"/><label kind="synchronisation" x="-56" y="-16">sack0!</label><nail x="16" y="0"/><nail x="-64" y="0"/></transition><transition><source ref="id4"/><target ref="id2"/><label kind="synchronisation" x="-56" y="-40">rack0?</label><nail x="-72" y="-24"/></transition><transition><source ref="id3"/><target ref="id4"/><label kind="synchronisation" x="-56" y="-72">r0!</label><nail x="16" y="-56"/><nail x="-80" y="-56"/></transition><transition><source ref="id4"/><target ref="id3"/><label kind="synchronisation" x="-56" y="-96">s0?</label><nail x="-80" y="-80"/></transition></template><template><name>Receiver</name><location id="id5" x="-88" y="64"><name x="-128" y="64">Ack</name></location><location id="id6" x="-88" y="-24"><name x="-112" y="-56">Receive</name></location><init ref="id6"/><transition><source ref="id5"/><target ref="id6"/><label kind="synchronisation" x="-136" y="8">rack0!</label></transition><transition><source ref="id6"/><target ref="id5"/><label kind="synchronisation" x="-56" y="40">r0?</label><nail x="-16" y="-24"/><nail x="-16" y="64"/></transition></template><system>// Place template instantiations here.

// List one or more processes to be composed into a system.
system Sender, Medium, Receiver;</system></nta>

1 个答案:

答案 0 :(得分:0)

您在问题中发布的XML本身格式不正确,但格式正确。该错误消息专门引用了XML中引用的DTD,但您没有在问题中包括该错误信息。您应该删除DOCTYPE行,或修复引用的DTD。如果您对DTD的问题有疑问,则应编辑问题并将DTD添加到其中。