Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Ajax Programming

How to split one XML into smaller XML, received via XMLHttpRequest?


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:

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc