1 : /*
2 : +----------------------------------------------------------------------+
3 : | PHP Version 6 |
4 : +----------------------------------------------------------------------+
5 : | Copyright (c) 1997-2009 The PHP Group |
6 : +----------------------------------------------------------------------+
7 : | This source file is subject to version 3.01 of the PHP license, |
8 : | that is bundled with this package in the file LICENSE, and is |
9 : | available through the world-wide-web at the following url: |
10 : | http://www.php.net/license/3_01.txt |
11 : | If you did not receive a copy of the PHP license and are unable to |
12 : | obtain it through the world-wide-web, please send a note to |
13 : | license@php.net so we can mail you a copy immediately. |
14 : +----------------------------------------------------------------------+
15 : | Authors: Christian Stocker <chregu@php.net> |
16 : | Rob Richards <rrichards@php.net> |
17 : +----------------------------------------------------------------------+
18 : */
19 :
20 : /* $Id: notation.c 281094 2009-05-25 14:32:15Z felipe $ */
21 :
22 : #ifdef HAVE_CONFIG_H
23 : #include "config.h"
24 : #endif
25 :
26 : #include "php.h"
27 : #if HAVE_LIBXML && HAVE_DOM
28 : #include "php_dom.h"
29 :
30 : /*
31 : * class DOMNotation extends DOMNode
32 : *
33 : * URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-5431D1B9
34 : * Since:
35 : */
36 :
37 : const zend_function_entry php_dom_notation_class_functions[] = {
38 : {NULL, NULL, NULL}
39 : };
40 :
41 : /* {{{ attribute protos, not implemented yet */
42 :
43 : /* {{{ publicId string
44 : readonly=yes
45 : URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-54F2B4D0
46 : Since:
47 : */
48 : int dom_notation_public_id_read(dom_object *obj, zval **retval TSRMLS_DC)
49 2 : {
50 : xmlEntityPtr nodep;
51 :
52 2 : nodep = (xmlEntityPtr) dom_object_get_node(obj);
53 :
54 2 : if (nodep == NULL) {
55 0 : php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
56 0 : return FAILURE;
57 : }
58 :
59 2 : ALLOC_ZVAL(*retval);
60 2 : if (nodep->ExternalID) {
61 2 : ZVAL_XML_STRING(*retval, (char *) (nodep->ExternalID), ZSTR_DUPLICATE);
62 : } else {
63 0 : ZVAL_EMPTY_UNICODE(*retval);
64 : }
65 :
66 2 : return SUCCESS;
67 : }
68 :
69 : /* }}} */
70 :
71 : /* {{{ systemId string
72 : readonly=yes
73 : URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-E8AAB1D0
74 : Since:
75 : */
76 : int dom_notation_system_id_read(dom_object *obj, zval **retval TSRMLS_DC)
77 2 : {
78 : xmlEntityPtr nodep;
79 :
80 2 : nodep = (xmlEntityPtr) dom_object_get_node(obj);
81 :
82 2 : if (nodep == NULL) {
83 0 : php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
84 0 : return FAILURE;
85 : }
86 :
87 2 : ALLOC_ZVAL(*retval);
88 2 : if (nodep->SystemID) {
89 2 : ZVAL_XML_STRING(*retval, (char *) (nodep->SystemID), ZSTR_DUPLICATE);
90 : } else {
91 0 : ZVAL_EMPTY_UNICODE(*retval);
92 : }
93 :
94 2 : return SUCCESS;
95 : }
96 :
97 : /* }}} */
98 :
99 : /* }}} */
100 :
101 : #endif
102 :
103 : /*
104 : * Local variables:
105 : * tab-width: 4
106 : * c-basic-offset: 4
107 : * End:
108 : * vim600: noet sw=4 ts=4 fdm=marker
109 : * vim<600: noet sw=4 ts=4
110 : */
|