webForumDet fria alternativet

Hämta ut XML-element med Flash-objektet!

Flash

2 svar · 179 visningar · startad av Poppe25

Medlem sedan apr. 2002255 inlägg
Frågan#1

Om jag har xmlobjekt som läst in:
<root>
<xmltagg> innehåll </xmltagg>
</root>

Hur hämtar jag ut innehåll?

Medlem sedan jan. 200329 inlägg
#2

Hej! Detta hittade jag på www.xmlinflash.com under FAQ. Hoppas det hjälper lite iallafall!
/Dennis

This is a common problem for newbies. For example, say you have the following node:

<ournode>here’s some text</ournode>

You really have two nodes: one is <ournode> and the other is its child, a text node. Yes, that’s right. Text is stored in its own node. If ourNode.nodeName is ournode, then ourNode.firstChild.nodeValue is here’s some text. If you read that again carefully, you’ll notice that you get the value of text from a text node by using nodeValue, and you retrieve the name of an element node by using nodeName.

Medlem sedan apr. 2002255 inlägg
#3

Dunder! Precis vad man behöver veta. Hade sett att man gjorde så precis, men nu vet jag också varför

255 ms totalt · 4 externa anrop · v20260731065814-full.e96017d9
126 ms — deklarationer (db)
0 ms — hämta statistik (cache)
127 ms — hämta tråd, inlägg och bilagor (db)
126 ms — ändringar (db)