Hi!
After sending a request to a server via XMLHttpRequest and receiving a
response, I assign the incoming XML from the Server via
[...]
var root = request.responseXML.documentElement;
[...]
to the variable 'root' which I process further with root.nodeType,
root.nodeValue, etc...
In my example I have the following XML File:
<activities>
<day date="20061001">
<activity>I did this</activity>
<activity>I did that</activity)
</day>
<day date="20061002">
<activity>I was doing this</activity>
<activity>And this</activity>
<activity>And that</activity>
</day>
<day date="20061003">
<activity>and so on</activity>
</day>
</activities>
Now here is my question: How can I assign the big XML (root:
activities) into e.g. three smaller XML's (with the new root: day) to
an array in JavaScript?
Thanks,
Norbert
Would something like this work for you?
var root = request.responseXML.documentElement;
var days = root.getElementsByTagName("day");
Eric
On 1/3/07, NorbertH <norbert.kell@myegrannie.com> wrote:
> Hi!
> After sending a request to a server via XMLHttpRequest and receiving a
> response, I assign the incoming XML from the Server via
> [...]
> var root = request.responseXML.documentElement;
> [...]
> to the variable 'root' which I process further with root.nodeType,
> root.nodeValue, etc...
> In my example I have the following XML File:
> <activities>
> <day date="20061001">
> <activity>I did this</activity>
> <activity>I did that</activity)
> </day>
> <day date="20061002">
> <activity>I was doing this</activity>
> <activity>And this</activity>
> <activity>And that</activity>
> </day>
> <day date="20061003">
> <activity>and so on</activity>
> </day>
> </activities>
> Now here is my question: How can I assign the big XML (root:
> activities) into e.g. three smaller XML's (with the new root: day) to
> an array in JavaScript?
> Thanks,
> Norbert