【问题标题】:XML error: Markup declaration must be well formedXML 错误:标记声明必须格式正确
【发布时间】:2019-12-16 20:45:46
【问题描述】:

[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>

【问题讨论】:

    标签: xml markup


    【解决方案1】:

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

    【讨论】:

    • 嗨,您有三个模板标签。将这些标签放在 ........
    • @LDS:为什么?错误消息指出文档类型声明必须格式正确。你的观察是关于有效性的。 Validity and well-formedness 不一样。
    • 你是正确的。但我在 google crome 中打开它并发现它很好并且得到了 taht。但如果你验证它可能会发生
    • @LDS:抱歉,如果您需要回复,您必须写得更清楚。
    • 嗨其实我在google crome中打开它并且打开很顺畅。如果有任何错误可能无法从顶部打开到按钮
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多