Mozilla save method for xml ? anything new?

View: New views
4 Messages — Rating Filter:   Alert me  

Mozilla save method for xml ? anything new?

by rvj-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


its been some while since the dom level 3 load and save spec was issued

.. but Mozilla still only supports the load() method ??


Whats happening


....or is there any best practice for implimenting document  save()
functionality ??


_______________________________________________
dev-tech-xml mailing list
dev-tech-xml@...
https://lists.mozilla.org/listinfo/dev-tech-xml

Re: Mozilla save method for xml ? anything new?

by SmauG-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 8/15/09 2:53 PM, rvj wrote:

> its been some while since the dom level 3 load and save spec was issued
>
> .. but Mozilla still only supports the load() method ??
>
>
> Whats happening
>
>
> ....or is there any best practice for implimenting document  save()
> functionality ??
>
>
load() is not part of DOM3 Load&Safe.
See https://bugzilla.mozilla.org/show_bug.cgi?id=494705
and https://bugzilla.mozilla.org/show_bug.cgi?id=155749

Can't you use XMLHttpRequest/DOMParser/XMLSerializer?


-Olli
_______________________________________________
dev-tech-xml mailing list
dev-tech-xml@...
https://lists.mozilla.org/listinfo/dev-tech-xml

Re: Mozilla save method for xml ? anything new?

by rvj-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


 I did try saving to file using the httpxmlrequest + serializer using
example  code
at https://developer.mozilla.org/en/Parsing_and_serializing_XML

....but I get  "ns_error_file_not_found" [x80520012] message during init()

I'm not sure if this means an error file or the output file.

Do you happen to know if the outputfile (dom.xml) has to exist before hand
....or is it deleted&created automatically ?

*************************************************************

var serializer = new XMLSerializer();
var foStream =
Components.classes["@mozilla.org/network/file-output-stream;1"]
               .createInstance(Components.interfaces.nsIFileOutputStream);
var file = Components.classes["@mozilla.org/file/directory_service;1"]
           .getService(Components.interfaces.nsIProperties)
           .get("ProfD", Components.interfaces.nsIFile); // get profile
folder
file.append("extensions");   // extensions sub-directory
file.append("{5872365E-67D1-4AFD-9480-FD293BEBD20D}");   // GUID of your
extension
file.append("dom.xml");   // filename
foStream.init(file, 0x02 | 0x08 | 0x20, 0664, 0);   // write, create,
truncate
serializer.serializeToStream(doc, foStream, "");   // rememeber, doc is the
DOM tree
foStream.close();


********************************************************

PS

 dont you mean save()  is not part of DOM3 Load&Safe.?
>>
> load() is not part of DOM3 Load&Safe.
> See https://bugzilla.mozilla.org/show_bug.cgi?id=494705
> and https://bugzilla.mozilla.org/show_bug.cgi?id=155749
>
> Can't you use XMLHttpRequest/DOMParser/XMLSerializer?
>

PPS

I would still be interested in knowing whether support for document.load
(and document.save) is only a temporary
feature !!
.


_______________________________________________
dev-tech-xml mailing list
dev-tech-xml@...
https://lists.mozilla.org/listinfo/dev-tech-xml

Re: Mozilla save method for xml ? anything new?

by rvj-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

PPPS I managed to get the file to write using localfile rather than profile
directory

   but probably the real problem wasVista security settings


"rvj" <rvj@...> wrote in message
news:_q2dncdy5YYRLhbXnZ2dnUVZ_sudnZ2d@......

>
> I did try saving to file using the httpxmlrequest + serializer using
> example  code
> at https://developer.mozilla.org/en/Parsing_and_serializing_XML
>
> ....but I get  "ns_error_file_not_found" [x80520012] message during init()
>
> I'm not sure if this means an error file or the output file.
>
> Do you happen to know if the outputfile (dom.xml) has to exist before hand
> ....or is it deleted&created automatically ?
>
> *************************************************************
>
> var serializer = new XMLSerializer();
> var foStream =
> Components.classes["@mozilla.org/network/file-output-stream;1"]
>               .createInstance(Components.interfaces.nsIFileOutputStream);
> var file = Components.classes["@mozilla.org/file/directory_service;1"]
>           .getService(Components.interfaces.nsIProperties)
>           .get("ProfD", Components.interfaces.nsIFile); // get profile
> folder
> file.append("extensions");   // extensions sub-directory
> file.append("{5872365E-67D1-4AFD-9480-FD293BEBD20D}");   // GUID of your
> extension
> file.append("dom.xml");   // filename
> foStream.init(file, 0x02 | 0x08 | 0x20, 0664, 0);   // write, create,
> truncate
> serializer.serializeToStream(doc, foStream, "");   // rememeber, doc is
> the DOM tree
> foStream.close();
>
>
> ********************************************************
>
> PS
>
> dont you mean save()  is not part of DOM3 Load&Safe.?
>>>
>> load() is not part of DOM3 Load&Safe.
>> See https://bugzilla.mozilla.org/show_bug.cgi?id=494705
>> and https://bugzilla.mozilla.org/show_bug.cgi?id=155749
>>
>> Can't you use XMLHttpRequest/DOMParser/XMLSerializer?
>>
>
> PPS
>
> I would still be interested in knowing whether support for document.load
> (and document.save) is only a temporary
> feature !!
> .
>


_______________________________________________
dev-tech-xml mailing list
dev-tech-xml@...
https://lists.mozilla.org/listinfo/dev-tech-xml