php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
entity.c
Go to the documentation of this file.
1/*
2 +----------------------------------------------------------------------+
3 | Copyright (c) The PHP Group |
4 +----------------------------------------------------------------------+
5 | This source file is subject to version 3.01 of the PHP license, |
6 | that is bundled with this package in the file LICENSE, and is |
7 | available through the world-wide-web at the following url: |
8 | https://www.php.net/license/3_01.txt |
9 | If you did not receive a copy of the PHP license and are unable to |
10 | obtain it through the world-wide-web, please send a note to |
11 | license@php.net so we can mail you a copy immediately. |
12 +----------------------------------------------------------------------+
13 | Authors: Christian Stocker <chregu@php.net> |
14 | Rob Richards <rrichards@php.net> |
15 +----------------------------------------------------------------------+
16*/
17
18#ifdef HAVE_CONFIG_H
19#include <config.h>
20#endif
21
22#include "php.h"
23#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
24#include "php_dom.h"
25#include "dom_properties.h"
26
27
28/*
29* class DOMEntity extends DOMNode
30*
31* URL: https://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-527DCFF2
32* Since:
33*/
34
35/* {{{ publicId string
36readonly=yes
37URL: https://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D7303025
38Since:
39*/
41{
42 DOM_PROP_NODE(xmlEntityPtr, nodep, obj);
43
44 if (nodep->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY || !nodep->ExternalID) {
46 } else {
47 ZVAL_STRING(retval, (const char *) nodep->ExternalID);
48 }
49
50 return SUCCESS;
51}
52
53/* }}} */
54
55/* {{{ systemId string
56readonly=yes
57URL: https://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D7C29F3E
58Since:
59*/
61{
62 DOM_PROP_NODE(xmlEntityPtr, nodep, obj);
63
64 if (nodep->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
66 } else {
67 ZVAL_STRING(retval, (const char *) nodep->SystemID);
68 }
69
70 return SUCCESS;
71}
72
73/* }}} */
74
75/* {{{ notationName string
76readonly=yes
77URL: https://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-6ABAEB38
78Since:
79*/
81{
82 DOM_PROP_NODE(xmlEntityPtr, nodep, obj);
83
84 if (nodep->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
86 } else {
87 /* According to spec, NULL is only allowed for unparsed entities, if it's not set we should use the empty string. */
88 if (!nodep->content) {
90 } else {
91 ZVAL_STRING(retval, (const char *) nodep->content);
92 }
93 }
94
95 return SUCCESS;
96}
97
98/* }}} */
99
100/* {{{ actualEncoding string
101readonly=yes
102URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Entity3-actualEncoding
103Since: DOM Level 3
104*/
106{
107 PHP_DOM_DEPRECATED_PROPERTY("Property DOMEntity::$actualEncoding is deprecated");
108
110 return SUCCESS;
111}
112
113/* }}} */
114
115/* {{{ encoding string
116readonly=yes
117URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Entity3-encoding
118Since: DOM Level 3
119*/
121{
122 PHP_DOM_DEPRECATED_PROPERTY("Property DOMEntity::$encoding is deprecated");
123
125 return SUCCESS;
126}
127
128/* }}} */
129
130/* {{{ version string
131readonly=yes
132URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Entity3-version
133Since: DOM Level 3
134*/
136{
137 PHP_DOM_DEPRECATED_PROPERTY("Property DOMEntity::$version is deprecated");
138
140 return SUCCESS;
141}
142
143/* }}} */
144
145#endif
zend_result dom_entity_public_id_read(dom_object *obj, zval *retval)
zend_result dom_entity_version_read(dom_object *obj, zval *retval)
#define DOM_PROP_NODE(type, name, obj)
zend_result dom_entity_notation_name_read(dom_object *obj, zval *retval)
zend_result dom_entity_actual_encoding_read(dom_object *obj, zval *retval)
zend_result dom_entity_encoding_read(dom_object *obj, zval *retval)
zend_result dom_entity_system_id_read(dom_object *obj, zval *retval)
#define SUCCESS
Definition hash_sha3.c:261
#define PHP_DOM_DEPRECATED_PROPERTY(message)
Definition php_dom.h:309
struct _dom_object dom_object
#define ZVAL_STRING(z, s)
Definition zend_API.h:956
#define ZVAL_EMPTY_STRING(z)
Definition zend_API.h:961
struct _zval_struct zval
#define ZVAL_NULL(z)
ZEND_RESULT_CODE zend_result
Definition zend_types.h:64
zval retval