Re: [PHP-XML-DEV] serializing DomDocument objects.

[email protected] (Christian Stocker)
Newsgroups php.xml.dev
Message-ID <[email protected]>

On 9/26/03 11:02 AM, Neill Roy wrote:
>> From: Christian Stocker <[email protected]>
>> To: neill <[email protected]>
>> CC: [email protected]
>> Subject: Re: [PHP-XML-DEV] serializing DomDocument objects.
>> Date: Fri, 26 Sep 2003 10:00:49 +0200
>>
>>
>>
>> On 9/26/03 9:52 AM, neill wrote:
>>
>>> Hi all. I was just wondering why my attempts to serialize DomDocument
>>> objects have failed? Is this a bug, or am I doing something wrong?
>>
>>
>> what does serializing exactly mean for you?
>>
>> $serializedxml = $domdocument->saveXML();
>>
>> should serialize it to a string.
> 
> 
> i want to serialize a whole DomDocument _object_ using the
> serialize() function. something like:
> $domDoc = new DomDocument()
> $domDoc->load('foo.xml')
> file_put_contents('file', serialize($domDoc))

which is almost the same as

$domDoc = new DomDocument()
$domDoc->load('foo.xml')
file_put_contents('file', $domDoc->saveXML())

chregu

> 
>>
>>> I am also unable to save DomDocument's in session variables (not that I
>>> want to do that or anything, just testing). I get "Warning: Couldn't 
>>> fetch
>>> domdocument in..." when i try to use the object after storing it.
>>
>>
>> not possible, never will be possible (AFAIK).
> 
> 
> ok. i'm not bothered about that because i'd never want to do it. i was
> just testing whether it was possible after my attempts at serialize()ing
> failed.
> 
> 
> neill.
> 
> _________________________________________________________________
> Get Hotmail on your mobile phone http://www.msn.co.uk/msnmobile

-- 
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60  | fax +41 1 240 56 71
http://www.bitflux.ch  |  [email protected]  |  gnupg-keyid 0x5CE1DECB
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.