ID:               31934
 Updated by:       [EMAIL PROTECTED]
 Reported By:      mezger dot michael at t-online dot de
-Status:           Open
+Status:           Bogus
 Bug Type:         DOM XML related
 Operating System: Windows 2000 Server
 PHP Version:      5.0.1
 New Comment:

in order to get those properties set in your class constructor, you
need to call parent::__construct(); as your first line in your
constructor.


Previous Comments:
------------------------------------------------------------------------

[2005-02-11 16:28:27] mezger dot michael at t-online dot de

Description:
------------
I made a subclass which extends the domdocument class. When i try to
set the formatOutput or preserveWhiteSpace property within this
subclass, it doesnt work. 

when i create a domdocument object and set it not through a subclass,
it works fine. I dont know if this is a bug?!

Reproduce code:
---------------
class guestbook extends domdocument {
  function guestbook($file){

    $this->preserveWhiteSpace = FALSE;
    $this->formatOutput = TURE;   //format the guestbook.xml
    $this->load($file);  //load XML File
    $this->save($file);
                
  } 
}

$guestbook = new guestbook("test.xml");
var_dump($guestbook->preserveWhiteSpace); //echo: (boolean) true
var_dump($guestbook->formatOutput); //echo: (boolean) false


//This code above works
$guestbook2 = new domdocument();
$guestbook2->load("test.xml");
$guestbook2->preserveWhiteSpace = FALSE;
$guestbook2->formatOutput = TRUE;

var_dump($guestbook2->preserveWhiteSpace); //echo: (boolean) false
var_dump($guestbook2->formatOutput); //echo: (boolean) true



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=31934&edit=1

Reply via email to