Re: [PHP-XML-DEV] serializing DomDocument objects.
[email protected] (neill)
| Newsgroups | php.xml.dev |
|---|---|
| Message-ID | <[email protected]> |
On Fri, 26 Sep 2003 12:35:06 +0200, Derick Rethans wrote: > On Fri, 26 Sep 2003, neill wrote: > >> > you have a DomDocument with child-elements? >> > >> > No, it's not possible (even if you don't have Child-elements). libxml2 >> > has no possibility to "serialize" their internal tree and will not have >> > in the soon future. >> > >> > Therefore the only solution is to use saveXML(). We could (but i don't >> > know the details) wrap that around serialize, but it doesn't make much >> > sense to me and speed gain would be zero... >> >> ok. well, maybe you could talk to the other developer's and see if they >> understand my point - and whether it would be worthwhile to add the >> ability to serialize DomDocuent objects. > > It's not possible. saveXML GIVES you a serialized form of your > DocDocument... that's the whole point of DOM. say i use saveXML(), and save the "serialized form of my DomDocument" to a file. if i then load this XML into a DomDocument object (correct me if i'm wrong) the "internal tree" would still have to be recreated. This is what i read was resource intensive. this is the process i wanted to avoid repeating by serializing the object. but serializing is not possible. no problem. >> i'm not saying "i'm right you're >> wrong" or anything like that, all i want is to make my software as fast as >> possible, and i thought serializing would help by avoiding having to >> create the "internal tree" again and again. > > Perhaps you'd need to rethink your design... no. my design is fine :P > Derick -- riot.