1 : /*
2 : +----------------------------------------------------------------------+
3 : | PHP Version 5 |
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 272374 2008-12-31 11:17:49Z sebastian $ */
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 : /*
32 : * class DOMNotation extends DOMNode
33 : *
34 : * URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-5431D1B9
35 : * Since:
36 : */
37 :
38 : zend_function_entry php_dom_notation_class_functions[] = {
39 : {NULL, NULL, NULL}
40 : };
41 :
42 : /* {{{ attribute protos, not implemented yet */
43 :
44 : /* {{{ publicId string
45 : readonly=yes
46 : URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-54F2B4D0
47 : Since:
48 : */
49 : int dom_notation_public_id_read(dom_object *obj, zval **retval TSRMLS_DC)
50 2 : {
51 : xmlEntityPtr nodep;
52 :
53 2 : nodep = (xmlEntityPtr) dom_object_get_node(obj);
54 :
55 2 : if (nodep == NULL) {
56 0 : php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
57 0 : return FAILURE;
58 : }
59 :
60 2 : ALLOC_ZVAL(*retval);
61 2 : if (nodep->ExternalID) {
62 2 : ZVAL_STRING(*retval, (char *) (nodep->ExternalID), 1);
63 : } else {
64 0 : ZVAL_EMPTY_STRING(*retval);
65 : }
66 :
67 2 : return SUCCESS;
68 : }
69 :
70 : /* }}} */
71 :
72 :
73 :
74 : /* {{{ systemId string
75 : readonly=yes
76 : URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-E8AAB1D0
77 : Since:
78 : */
79 : int dom_notation_system_id_read(dom_object *obj, zval **retval TSRMLS_DC)
80 2 : {
81 : xmlEntityPtr nodep;
82 :
83 2 : nodep = (xmlEntityPtr) dom_object_get_node(obj);
84 :
85 2 : if (nodep == NULL) {
86 0 : php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
87 0 : return FAILURE;
88 : }
89 :
90 2 : ALLOC_ZVAL(*retval);
91 2 : if (nodep->SystemID) {
92 2 : ZVAL_STRING(*retval, (char *) (nodep->SystemID), 1);
93 : } else {
94 0 : ZVAL_EMPTY_STRING(*retval);
95 : }
96 :
97 2 : return SUCCESS;
98 : }
99 :
100 : /* }}} */
101 :
102 : #endif
|