XML Flash Object Q?
- Started
- Last post
- 8 Responses
- phlojonaut
I was under the impression that is the following case:
Question Text
- the nameName of the above child is : question
- the NodeValue of the above child is : Question Text
- the nodeType : 3 (text)but I think I understood the XML schema wrong...
because it looks like "Question Text" is not the nodeValue of but the firstChild ofbut again, I'm not sure...
What's going on here...
how can i store the nodeName and the nodeValue in the same child ?thanks
- unformatted0
huh? that sounds confusing, or maybe i'm still half a sleep.
how is your xml setup?
{question}Question Text{/question}
nodeName would be "question", node Value is "question text"
what's your question again?
- phlojonaut0
that is exacly what i was thinking but i realised that it's not like that
it seams likequestion text is not the value of the question node, but the child of it....
not sure why, or not sure if maybe it should just be like this....
- unformatted0
it's actually both. "question text" is the firstChild of "question".
it is also the nodeValue of "question"
- phlojonaut0
are you 100% sure about that ?
that's what i tought...
but that's not what is happening for mei can't seam to have a child which has a nodeName and nodeValue at the same time, in Flash
this is my xml file:
I am employed at...
The Government
An Educational Institutionand when i try to get the nodeName of the level3 child, which is the "words" node, it returns "words", which is what i expected it.... but when I try to get the nodeValue of the same child, i get a "null" return
if i try to get the llevel3.firstChild nodeName, that's when i get "null" but the nodeValue of this same node.... is "I am employed at"
so in other words, it looks like within flash, either the nodeName or the nodeValue have to be null.... they can't both have data at the same time...
am I correct here ?
- phlojonaut0
fuck....
the brakets did not save right{questions}
{question id="1"}
{words}I am employed at...
{/words}
{/question}
{/questions}hope this works
- unformatted0
that's because when you use "llevel3.firstChild nodeName" you are still at the node {words}. so to find the value of {words} you have to move to the next child. all text, elements, are "nodes".
so to find the value of {words} llevel3.firstChild.firstChild.no...
make sense?
- phlojonaut0
yes it does.... thanks
xml is so simple..... yet so complicated
- unformatted0
no prob. it's only a bitch when you first start learning it. :)