Thanks for the answer, but I've seen this before, and again, I want to
*create* and *save* a document in a browser in Javascript, not load one,
and this example doesnt explain creating and saving an XML, just loading
one. I need something like:
var obj = new XMLDoc();
var item = obj.AddNode(a);
var item2 = obj.AddNode(b);
var xml = obj.contentXml;
and then be able to send this to a PHP page through XMLHttpRequest or
whatever.
So please if someone ever created and saved in a variable some XML text
created using DOM on a browser, let me know. I'm not talking about
making my own function to create the XML, but this is what I might end
up doing. I just thought it would be cleaner to use a DOM object, which
is more consistent with other widely used techniques.
-----
William
Laurent Bugnion wrote:[color=blue]
> Hi,
>
> William wrote:[color=green]
>> Heya,
>>
>> I have been looking all over Google for ways to *create* an XML
>> document using any Javascript object, and it seems that no one has
>> ever tried or ever needed this.
>>
>> I want to send the server some info dynamically created on the page,
>> and instead of sending a complicated GET request with the info, or
>> creating an XML using my own set of functions, is there any object
>> that allows you to use the Document Object Model, like adding nodes,
>> etc, and then output the XML text at the end you could then send to
>> the server? It seems XMLHttpRequest is only for requests, and I don't
>> want to use Microsoft-only ActiveX XML objects.
>>
>> Any idea?
>>
>> Thanks,
>>
>> ------
>> William[/color]
>
> The XML objects are not IE only, see
>
http://www.quirksmode.org/dom/importxml.html
> for a cross-browser example. I implemented the example and tested in
> Firefox, it works. Is that what you're looking for?
>
> Greetings,
> Laurent[/color]