[Phpxd-commits] CVS: phpXD/include/dom DOMWriter.php,1.1,1.2 Document.php,1.6,1.7
Status: Beta
Brought to you by:
growbal
|
From: Thomas D. <th...@us...> - 2002-03-04 16:58:46
|
Update of /cvsroot/phpxd/phpXD/include/dom
In directory usw-pr-cvs1:/tmp/cvs-serv14473/include/dom
Modified Files:
DOMWriter.php Document.php
Log Message:
Index: DOMWriter.php
===================================================================
RCS file: /cvsroot/phpxd/phpXD/include/dom/DOMWriter.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** DOMWriter.php 3 Mar 2002 06:23:16 -0000 1.1
--- DOMWriter.php 4 Mar 2002 16:58:42 -0000 1.2
***************
*** 9,13 ****
/**
* Class representing the DOMWriter interface.
- *
*
* @package phpXD
--- 9,12 ----
***************
*** 17,25 ****
*/
class DOMWriter {
-
/**
! * An array for saving DOMWriter's names features.<br>
! * array keys are feature names. array values are feature states(true or false).<br>
! *
* DOM-Level 3
*
--- 16,23 ----
*/
class DOMWriter {
/**
! * An array for saving DOMWriter's names features.
! * The array keys are the feature names. The array values are the
! * feature states (true or false).<br>
* DOM-Level 3
*
***************
*** 27,43 ****
* @type array
*/
-
var $namedFeatures;
/**
! * The character encoding in which the output will be written.<br>
! * The encoding to use when writing is determined as follows: <br>
* <li>If the encoding attribute has been set, that value will be used. <br>
! * <li>If the encoding attribute is null or empty, but the item to be <br>
! * written includes an encoding declaration, that value will be used. <br>
! * <li>If neither of the above provides an encoding name, a default encoding <br>
! * of "UTF-8" will be used. <br>
!
!
* DOM-Level 3
*
--- 25,38 ----
* @type array
*/
var $namedFeatures;
/**
! * The character encoding in which the output will be written.
! * The encoding to use when writing is determined as follows: <br><ul>
* <li>If the encoding attribute has been set, that value will be used. <br>
! * <li>If the encoding attribute is null or empty, but the item to be
! * written includes an encoding declaration, that value will be used.<br>
! * <li>If neither of the above provides an encoding name, a default
! * encoding of "UTF-8" will be used. </ul><br>
* DOM-Level 3
*
***************
*** 45,57 ****
* @type string
*/
-
var $encoding;
/**
! * The actual character encoding that was last used by this formatter.<br>
! * This convenience method allows the encoding that was used <br>
* when serializing a document to be directly obtained.<br>
- * Readonly<br>
- *
* DOM-Level 3
*
--- 40,49 ----
* @type string
*/
var $encoding;
/**
! * The actual character encoding that was last used by this formatter.
! * This convenience method allows the encoding that was used
* when serializing a document to be directly obtained.<br>
* DOM-Level 3
*
***************
*** 59,72 ****
* @type string
*/
-
var $lastEncoding;
/**
! * The error handler that will receive error notifications <br>
! * during serialization. The node where the error occured is <br>
! * passed to this error handler, any modification to nodes <br>
! * from within an error callback should be avoided since this<br>
! * will result in undefined, implementation dependent behavior.<br>
! *
* DOM-Level 3
*
--- 51,63 ----
* @type string
*/
var $lastEncoding;
/**
! * The error handler that will receive error notifications
! * during serialization.
! * The node where the error occured is passed to this error handler,
! * any modification to nodes from within an error callback should be
! * avoided since this will result in undefined, implementation dependent
! * behavior.<br>
* DOM-Level 3
*
***************
*** 74,88 ****
* @type string
*/
-
var $errorHandler;
/**
! * The end-of-line sequence of characters to be used in<br>
! * the XML being written out. The only permitted values are these: <br>
! * <li> null<br>
! * <li> CR <br>
! * <li> CR-LF <br>
! * <li> LF <br>
! *
* DOM-Level 3
*
--- 65,77 ----
* @type string
*/
var $errorHandler;
/**
! * The end-of-line sequence of characters to be used in
! * the XML being written out. The only permitted values are these: <br><ul>
! * <li>null
! * <li>CR
! * <li>CR-LF
! * <li>LF</ul><br>
* DOM-Level 3
*
***************
*** 90,94 ****
* @type string
*/
-
var $newLine;
--- 79,82 ----
***************
*** 111,119 ****
$this->encoding = "UTF-8";
! $this->$newLine = "\n"; //LF
}
/**
! * Returns true if the feature could be successfully set to the specified value.<br>
* DOM-Level 3
*
--- 99,108 ----
$this->encoding = "UTF-8";
! $this->newLine = "\n"; //LF
}
/**
! * Returns true if the feature could be successfully set to the specified
! * value.<br>
* DOM-Level 3
*
***************
*** 124,128 ****
*/
function setFeature($name, $state) {
! if ($this->canSetFeatureName($name))
if ($this->canSetFeature($name, $state)) {
$this->namedFeatures[$name] = $state;
--- 113,117 ----
*/
function setFeature($name, $state) {
! if ($this->canSetFeatureName($name)) {
if ($this->canSetFeature($name, $state)) {
$this->namedFeatures[$name] = $state;
***************
*** 134,144 ****
}
! } else
return NOT_SUPPORTED_ERR;
! else
return NOT_FOUND_ERR;
}
-
/**
* Returns true if the feature could be successfully set.<br>
--- 123,136 ----
}
! }
! else {
return NOT_SUPPORTED_ERR;
! }
! }
! else {
return NOT_FOUND_ERR;
+ }
}
/**
* Returns true if the feature could be successfully set.<br>
***************
*** 153,159 ****
}
-
/**
! * Returns true if the feature could be successfully set to the specified value.<br>
* DOM-Level 3
*
--- 145,151 ----
}
/**
! * Returns true if the feature could be successfully set to the specified
! * value.<br>
* DOM-Level 3
*
***************
*** 164,172 ****
*/
function canSetFeature($name, $state) {
! $canSetState = ($state===true || $state===false);
return canRecognizeFeatureName($name) && $canSetState;
}
-
/**
* Returns the current state of the feature (true or false).<br>
--- 156,163 ----
*/
function canSetFeature($name, $state) {
! $canSetState = ($state === true || $state === false);
return canRecognizeFeatureName($name) && $canSetState;
}
/**
* Returns the current state of the feature (true or false).<br>
***************
*** 178,201 ****
*/
function getFeature($name) {
! if ($this->canRecognizeFeatureName($name))
return $this->namedFeatures[$name];
! else
return NOT_FOUND_ERR;
}
-
/**
! * Write out the specified node in the description of DOMWriter. <br>
! *
! * Destination can be in these PHP supported output:
* <li> "/home/rasmus/file.xml"
! * <li> "ftp://user:pas...@ex.../file.xml"
! * <li> "php://stdout", or "php://stderr"
! *
! * On the Windows platform, be careful to escape any backslashes <br>
* used in the path to the file, or use forward slashes:
! * "c:\\data\\file.xml"
! *
! *
* DOM-Level 3
*
--- 169,189 ----
*/
function getFeature($name) {
! if ($this->canRecognizeFeatureName($name)) {
return $this->namedFeatures[$name];
! }
! else {
return NOT_FOUND_ERR;
+ }
}
/**
! * Write out the specified node in the description of DOMWriter.
! * Destination can be in these PHP supported output:<ul>
* <li> "/home/rasmus/file.xml"
! * <li> "ftp:/ /user:pas...@ex.../file.xml"
! * <li> "php:/ /stdout", or "php:/ /stderr"</ul>
! * On the Windows platform, be careful to escape any backslashes
* used in the path to the file, or use forward slashes:
! * "c:\\data\\file.xml".<br>
* DOM-Level 3
*
***************
*** 206,210 ****
*/
function writeNode($destination, $wnode) {
-
$ok = true;
if ($fp = fopen($destination, "w")) {
--- 194,197 ----
***************
*** 215,224 ****
fclose($fp);
}
! else
$ok = false;
return $ok;
}
-
/**
* Serialize the specified node in the description of DOMWriter.<br>
--- 202,211 ----
fclose($fp);
}
! else {
$ok = false;
+ }
return $ok;
}
/**
* Serialize the specified node in the description of DOMWriter.<br>
***************
*** 235,243 ****
}
-
-
/**
* Print indents for pretty format<br>
- *
*
* @private
--- 222,227 ----
***************
*** 259,263 ****
/**
* Serialize the specified node in the description of DOMWriter.<br>
- *
*
* @private
--- 243,246 ----
***************
*** 269,273 ****
*/
function writeToString2(&$dom, $trim, $indent, &$text) {
! $newLine=$this->$newLine;
$indentStr = $this->printIndent($indent);
--- 252,256 ----
*/
function writeToString2(&$dom, $trim, $indent, &$text) {
! $newLine = $this->newLine;
$indentStr = $this->printIndent($indent);
Index: Document.php
===================================================================
RCS file: /cvsroot/phpxd/phpXD/include/dom/Document.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** Document.php 13 Feb 2002 22:47:40 -0000 1.6
--- Document.php 4 Mar 2002 16:58:42 -0000 1.7
***************
*** 96,100 ****
* @public
* @param $name <code>string</code>
- * @param $value <code>string</code>
* @returns Attr
*/
--- 96,99 ----
***************
*** 112,116 ****
*
* @public
! * @param $data
* @returns CDataSection
*/
--- 111,115 ----
*
* @public
! * @param $data <code>string</code>
* @returns CDataSection
*/
|