Back to index

php5  5.3.10
php_encoding.h
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: Brad Lafountain <rodif_bl@yahoo.com>                        |
00016   |          Shane Caraveo <shane@caraveo.com>                           |
00017   |          Dmitry Stogov <dmitry@zend.com>                             |
00018   +----------------------------------------------------------------------+
00019 */
00020 /* $Id: php_encoding.h 321634 2012-01-01 13:15:04Z felipe $ */
00021 
00022 #ifndef PHP_ENCODING_H
00023 #define PHP_ENCODING_H
00024 
00025 #define XSD_1999_NAMESPACE "http://www.w3.org/1999/XMLSchema"
00026 #define XSD_1999_TIMEINSTANT 401
00027 #define XSD_1999_TIMEINSTANT_STRING "timeInstant"
00028 
00029 #define SOAP_1_1_ENV_NAMESPACE "http://schemas.xmlsoap.org/soap/envelope/"
00030 #define SOAP_1_1_ENV_NS_PREFIX "SOAP-ENV"
00031 
00032 #define SOAP_1_2_ENV_NAMESPACE "http://www.w3.org/2003/05/soap-envelope"
00033 #define SOAP_1_2_ENV_NS_PREFIX "env"
00034 
00035 #define SOAP_1_1_ENC_NAMESPACE "http://schemas.xmlsoap.org/soap/encoding/"
00036 #define SOAP_1_1_ENC_NS_PREFIX "SOAP-ENC"
00037 
00038 #define SOAP_1_2_ENC_NAMESPACE "http://www.w3.org/2003/05/soap-encoding"
00039 #define SOAP_1_2_ENC_NS_PREFIX "enc"
00040 
00041 #define SCHEMA_NAMESPACE "http://www.w3.org/2001/XMLSchema"
00042 #define XSD_NAMESPACE "http://www.w3.org/2001/XMLSchema"
00043 #define XSD_NS_PREFIX "xsd"
00044 #define XSI_NAMESPACE "http://www.w3.org/2001/XMLSchema-instance"
00045 #define XSI_NS_PREFIX "xsi"
00046 #define XML_NAMESPACE "http://www.w3.org/XML/1998/namespace"
00047 #define XML_NS_PREFIX "xml"
00048 
00049 #define XSD_STRING 101
00050 #define XSD_STRING_STRING "string"
00051 #define XSD_BOOLEAN 102
00052 #define XSD_BOOLEAN_STRING "boolean"
00053 #define XSD_DECIMAL 103
00054 #define XSD_DECIMAL_STRING "decimal"
00055 #define XSD_FLOAT 104
00056 #define XSD_FLOAT_STRING "float"
00057 #define XSD_DOUBLE 105
00058 #define XSD_DOUBLE_STRING "double"
00059 #define XSD_DURATION 106
00060 #define XSD_DURATION_STRING "duration"
00061 #define XSD_DATETIME 107
00062 #define XSD_DATETIME_STRING "dateTime"
00063 #define XSD_TIME 108
00064 #define XSD_TIME_STRING "time"
00065 #define XSD_DATE 109
00066 #define XSD_DATE_STRING "date"
00067 #define XSD_GYEARMONTH 110
00068 #define XSD_GYEARMONTH_STRING "gYearMonth"
00069 #define XSD_GYEAR 111
00070 #define XSD_GYEAR_STRING "gYear"
00071 #define XSD_GMONTHDAY 112
00072 #define XSD_GMONTHDAY_STRING "gMonthDay"
00073 #define XSD_GDAY 113
00074 #define XSD_GDAY_STRING "gDay"
00075 #define XSD_GMONTH 114
00076 #define XSD_GMONTH_STRING "gMonth"
00077 #define XSD_HEXBINARY 115
00078 #define XSD_HEXBINARY_STRING "hexBinary"
00079 #define XSD_BASE64BINARY 116
00080 #define XSD_BASE64BINARY_STRING "base64Binary"
00081 #define XSD_ANYURI 117
00082 #define XSD_ANYURI_STRING "anyURI"
00083 #define XSD_QNAME 118
00084 #define XSD_QNAME_STRING "QName"
00085 #define XSD_NOTATION 119
00086 #define XSD_NOTATION_STRING "NOTATION"
00087 #define XSD_NORMALIZEDSTRING 120
00088 #define XSD_NORMALIZEDSTRING_STRING "normalizedString"
00089 #define XSD_TOKEN 121
00090 #define XSD_TOKEN_STRING "token"
00091 #define XSD_LANGUAGE 122
00092 #define XSD_LANGUAGE_STRING "language"
00093 #define XSD_NMTOKEN 123
00094 #define XSD_NMTOKEN_STRING "NMTOKEN"
00095 #define XSD_NAME 124
00096 #define XSD_NAME_STRING "Name"
00097 #define XSD_NCNAME 125
00098 #define XSD_NCNAME_STRING "NCName"
00099 #define XSD_ID 126
00100 #define XSD_ID_STRING "ID"
00101 #define XSD_IDREF 127
00102 #define XSD_IDREF_STRING "IDREF"
00103 #define XSD_IDREFS 128
00104 #define XSD_IDREFS_STRING "IDREFS"
00105 #define XSD_ENTITY 129
00106 #define XSD_ENTITY_STRING "ENTITY"
00107 #define XSD_ENTITIES 130
00108 #define XSD_ENTITIES_STRING "ENTITIES"
00109 #define XSD_INTEGER 131
00110 #define XSD_INTEGER_STRING "integer"
00111 #define XSD_NONPOSITIVEINTEGER 132
00112 #define XSD_NONPOSITIVEINTEGER_STRING "nonPositiveInteger"
00113 #define XSD_NEGATIVEINTEGER 133
00114 #define XSD_NEGATIVEINTEGER_STRING "negativeInteger"
00115 #define XSD_LONG 134
00116 #define XSD_LONG_STRING "long"
00117 #define XSD_INT 135
00118 #define XSD_INT_STRING "int"
00119 #define XSD_SHORT 136
00120 #define XSD_SHORT_STRING "short"
00121 #define XSD_BYTE 137
00122 #define XSD_BYTE_STRING "byte"
00123 #define XSD_NONNEGATIVEINTEGER 138
00124 #define XSD_NONNEGATIVEINTEGER_STRING "nonNegativeInteger"
00125 #define XSD_UNSIGNEDLONG 139
00126 #define XSD_UNSIGNEDLONG_STRING "unsignedLong"
00127 #define XSD_UNSIGNEDINT 140
00128 #define XSD_UNSIGNEDINT_STRING "unsignedInt"
00129 #define XSD_UNSIGNEDSHORT 141
00130 #define XSD_UNSIGNEDSHORT_STRING "unsignedShort"
00131 #define XSD_UNSIGNEDBYTE 142
00132 #define XSD_UNSIGNEDBYTE_STRING "unsignedByte"
00133 #define XSD_POSITIVEINTEGER 143
00134 #define XSD_POSITIVEINTEGER_STRING "positiveInteger"
00135 #define XSD_NMTOKENS 144
00136 #define XSD_NMTOKENS_STRING "NMTOKENS"
00137 #define XSD_ANYTYPE 145
00138 #define XSD_ANYTYPE_STRING "anyType"
00139 #define XSD_UR_TYPE 146
00140 #define XSD_UR_TYPE_STRING "ur-type"
00141 
00142 #define XSD_ANYXML 147
00143 
00144 #define APACHE_NAMESPACE "http://xml.apache.org/xml-soap"
00145 #define APACHE_MAP 200
00146 #define APACHE_MAP_STRING "Map"
00147 
00148 #define SOAP_ENC_ARRAY 300
00149 #define SOAP_ENC_ARRAY_STRING "Array"
00150 #define SOAP_ENC_OBJECT 301
00151 #define SOAP_ENC_OBJECT_STRING "Struct"
00152 
00153 #define WSDL_NAMESPACE "http://schemas.xmlsoap.org/wsdl/"
00154 #define WSDL_NS_PREFIX "wsdl"
00155 
00156 #define WSDL_SOAP11_NAMESPACE "http://schemas.xmlsoap.org/wsdl/soap/"
00157 #define WSDL_SOAP12_NAMESPACE "http://schemas.xmlsoap.org/wsdl/soap12/"
00158 #define RPC_SOAP12_NAMESPACE  "http://www.w3.org/2003/05/soap-rpc"
00159 #define RPC_SOAP12_NS_PREFIX  "rpc"
00160 
00161 #define WSDL_HTTP11_NAMESPACE "http://schemas.xmlsoap.org/wsdl/http/"
00162 #define WSDL_HTTP12_NAMESPACE      "http://www.w3.org/2003/05/soap/bindings/HTTP/"
00163 #define WSDL_HTTP_NS_PREFIX "http"
00164 
00165 #define WSDL_HTTP_TRANSPORT "http://schemas.xmlsoap.org/soap/http"
00166 
00167 #define WSDL_MIME_NAMESPACE "http://schemas.xmlsoap.org/wsdl/mime/"
00168 
00169 #define WSDL_DIME_NAMESPACE "http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/"
00170 #define WSDL_DIME_OPEN      "http://schemas.xmlsoap.org/ws/2002/04/dime/open-layout"
00171 #define WSDL_DIME_CLOSED    "http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout"
00172 
00173 #define UNKNOWN_TYPE 999998
00174 #define END_KNOWN_TYPES 999999
00175 
00176 struct _encodeType {
00177        int type;
00178        char *type_str;
00179        char *ns;
00180        sdlTypePtr sdl_type;
00181        soapMappingPtr map;
00182 };
00183 
00184 struct _encode {
00185        encodeType details;
00186        zval *(*to_zval)(encodeTypePtr type, xmlNodePtr data);
00187        xmlNodePtr (*to_xml)(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
00188 };
00189 
00190 /* Master functions all encode/decode should be called thur these functions */
00191 xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr parent);
00192 zval *master_to_zval(encodePtr encode, xmlNodePtr data);
00193 
00194 /* user defined mapping */
00195 xmlNodePtr to_xml_user(encodeTypePtr type, zval *data, int style, xmlNodePtr parent);
00196 zval *to_zval_user(encodeTypePtr type, xmlNodePtr node);
00197 
00198 void whiteSpace_replace(xmlChar* str);
00199 void whiteSpace_collapse(xmlChar* str);
00200 
00201 xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval* data, int style, xmlNodePtr parent);
00202 zval *sdl_guess_convert_zval(encodeTypePtr enc, xmlNodePtr data);
00203 
00204 void encode_finish();
00205 void encode_reset_ns();
00206 xmlNsPtr encode_add_ns(xmlNodePtr node, const char* ns);
00207 
00208 encodePtr get_conversion(int encode);
00209 
00210 void delete_encoder(void *handle);
00211 void delete_encoder_persistent(void *handle);
00212 
00213 extern encode defaultEncoding[];
00214 extern int numDefaultEncodings;
00215 
00216 #endif