簡體   English   中英

TypeError:錯誤#1085:元素類型“ opi1”必須以匹配的結束標記“ </opi1> ”

[英]TypeError: Error #1085: The element type “opi1” must be terminated by the matching end-tag “</opi1>”

我正在使用Animate CC創建游戲測驗,我所有的問題和答案均來自XML文件。 我在測驗中有3個類別,每個類別都有4個問題。 其中2個工作正常,但其中一個有錯誤。 然后我收到了這個錯誤:

TypeError: Error #1085: The element type "opi1" must be terminated by the matching end-tag "</opi1>".

    at RelationCon/loadXML()[RelationCon::frame10:13]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()

這是來自第10幀的代碼:

import flash.net.URLLoader;
import flash.net.URLRequest;

var questioni: Array = new Array();
var answeri: Array = new Array();
var koreki: Array = new Array();
var loader3: URLLoader = new URLLoader();

loader3.addEventListener(Event.COMPLETE, loadXML);
loader3.load(new URLRequest("relations.xml"));

function loadXML(event: Event): void {
    var myxml3 = new XML(event.target.data);
    var loopo = myxml3.quesh.length();
    for (var i = 0; i < loopo; i++) {
        questioni[i] = myxml3.quesh[i].qt1;
        answeri[i] = [myxml3.quesh[i].opi1, myxml3.quesh[i].opi2, myxml3.quesh[i].opi3];
        koreki[i] = myxml3.quesh[i].opi1;
    }
    gotoAndPlay(11);
}

來自第13行:

var myxml3 = new XML(event.target.data);

這是我來自XML文件的代碼:

<?xml version="1.0" encoding="UTF-8"?>

<all> 

<quesh>
<qt1>A relation can be represented using a ___________.</qt1> 
<opi1>Directed graph</opi> 
<opi2>Indirected graph</opi2> 
<opi3>Bar graph</opi3>
</quesh>

<quesh>
<qt1>A type of relation on set X is the set {(x, x)|x ? X}.</qt1> 
<opi1>Identity</opi1> 
<opi2>Symmetry</opi2> 
<opi3>Empty</opi3>
</quesh>

<quesh>
<qt1>A relation R on a set A called ___ if ?a?A is related to a.</qt1> 
<opi1>Reflexive</opi1> 
<opi2>Asymmetry</opi2> 
<opi3>Symmetry</opi3>
</quesh>

<quesh>
<qt1>A relation R on set A is called ___________ if xRy and yRx implies x = y ?x ? A and ?y ? A.</qt1> 
<opi1>Anti-symmetric</opi1> 
<opi2>Reflexive</opi2> 
<opi3>Identity</opi3>
</quesh>


</all>

兩種代碼看起來都是正確的,但我不認為為什么會收到此錯誤。 我提供的那些代碼有什么問題嗎? 任何幫助將不勝感激。 謝謝!

<opi1>Directed graph</opi> 

無效,因為開始和結束標記不匹配。 一個在結尾處為1,而另一個則沒有。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM