Back to index

php5  5.3.10
notation.c
Go to the documentation of this file.
00001 /*
00002    +----------------------------------------------------------------------+
00003    | PHP Version 5                                                        |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1997-2012 The PHP Group                                |
00006    +----------------------------------------------------------------------+
00007    | This source file is subject to version 3.01 of the PHP license,      |
00008    | that is bundled with this package in the file LICENSE, and is        |
00009    | available through the world-wide-web at the following url:           |
00010    | http://www.php.net/license/3_01.txt                                  |
00011    | If you did not receive a copy of the PHP license and are unable to   |
00012    | obtain it through the world-wide-web, please send a note to          |
00013    | license@php.net so we can mail you a copy immediately.               |
00014    +----------------------------------------------------------------------+
00015    | Authors: Christian Stocker <chregu@php.net>                          |
00016    |          Rob Richards <rrichards@php.net>                            |
00017    +----------------------------------------------------------------------+
00018 */
00019 
00020 /* $Id: notation.c 321634 2012-01-01 13:15:04Z felipe $ */
00021 
00022 #ifdef HAVE_CONFIG_H
00023 #include "config.h"
00024 #endif
00025 
00026 #include "php.h"
00027 #if HAVE_LIBXML && HAVE_DOM
00028 #include "php_dom.h"
00029 
00030 /*
00031 * class DOMNotation extends DOMNode 
00032 *
00033 * URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-5431D1B9
00034 * Since: 
00035 */
00036 
00037 const zend_function_entry php_dom_notation_class_functions[] = {
00038        PHP_FE_END
00039 };
00040 
00041 /* {{{ attribute protos, not implemented yet */
00042 
00043 /* {{{ publicId      string 
00044 readonly=yes 
00045 URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-54F2B4D0
00046 Since: 
00047 */
00048 int dom_notation_public_id_read(dom_object *obj, zval **retval TSRMLS_DC)
00049 {
00050        xmlEntityPtr nodep;
00051 
00052        nodep = (xmlEntityPtr) dom_object_get_node(obj);
00053 
00054        if (nodep == NULL) {
00055               php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
00056               return FAILURE;
00057        }
00058 
00059        ALLOC_ZVAL(*retval);
00060        if (nodep->ExternalID) {
00061               ZVAL_STRING(*retval, (char *) (nodep->ExternalID), 1);
00062        } else {
00063               ZVAL_EMPTY_STRING(*retval);
00064        }
00065 
00066        return SUCCESS;
00067 }
00068 
00069 /* }}} */
00070 
00071 /* {{{ systemId      string 
00072 readonly=yes 
00073 URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-E8AAB1D0
00074 Since: 
00075 */
00076 int dom_notation_system_id_read(dom_object *obj, zval **retval TSRMLS_DC)
00077 {
00078        xmlEntityPtr nodep;
00079 
00080        nodep = (xmlEntityPtr) dom_object_get_node(obj);
00081 
00082        if (nodep == NULL) {
00083               php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
00084               return FAILURE;
00085        }
00086 
00087        ALLOC_ZVAL(*retval);
00088        if (nodep->SystemID) {
00089               ZVAL_STRING(*retval, (char *) (nodep->SystemID), 1);
00090        } else {
00091               ZVAL_EMPTY_STRING(*retval);
00092        }
00093 
00094        return SUCCESS;
00095 }
00096 
00097 /* }}} */
00098 
00099 /* }}} */
00100 
00101 #endif
00102 
00103 /*
00104  * Local variables:
00105  * tab-width: 4
00106  * c-basic-offset: 4
00107  * End:
00108  * vim600: noet sw=4 ts=4 fdm=marker
00109  * vim<600: noet sw=4 ts=4
00110  */