actionscript 3 - AS3: all key + values from XML attributes -


  & lt; शीर्ष & gt; & Lt; आइटम लिंक = "http://www.google.be" & gt; & lt;! [CDATA [परीक्षण]] & gt; & lt; / item & gt; & Lt; आइटम लिंक = "http://www.google.be" & gt; & lt;! [CDATA [परीक्षण]] & gt; & lt; / item & gt; & Lt; item bold = "true" link = "http://www.google.be" & gt; & lt;! [CDATA [परीक्षा]] & gt; & lt; / item & gt; & Lt; / शीर्ष & gt;  

मुझे सभी गुणों (कुंजी और मान दोनों)

  प्रत्येक के लिए (var मद: data.item में XML) {ट्रेस (आइटम । .attributes () नाम ()); }  

यह त्रुटि देता है

  TypeError: त्रुटि # 1086: नाम विधि केवल एक आइटम वाले सूचियों पर काम करती है 3 वें मद पर  

इसका कारण यह ऊपर उड़ा रहा है तीसरी वस्तु यह है कि इसमें दो विशेषताओं हैं आप एक शॉर्टकट का उपयोग कर रहे हैं जो केवल नाम प्राप्त करता है यदि केवल एक विशेषता है आपको अपने कोड को निम्नलिखित में बदलने की जरूरत है:

  प्रत्येक के लिए (var आइटम: डेटा में xml.items) {प्रत्येक में (var attr: item.attributes in XML) {trace ( attr.name ()); }}  

संपादित करें: नाम के बाद कोष्ठक लापता थे।


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -