Back to index

php5  5.3.10
Classes | Defines | Functions | Variables
php_encoding.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _encodeType
struct  _encode

Defines

#define XSD_1999_NAMESPACE   "http://www.w3.org/1999/XMLSchema"
#define XSD_1999_TIMEINSTANT   401
#define XSD_1999_TIMEINSTANT_STRING   "timeInstant"
#define SOAP_1_1_ENV_NAMESPACE   "http://schemas.xmlsoap.org/soap/envelope/"
#define SOAP_1_1_ENV_NS_PREFIX   "SOAP-ENV"
#define SOAP_1_2_ENV_NAMESPACE   "http://www.w3.org/2003/05/soap-envelope"
#define SOAP_1_2_ENV_NS_PREFIX   "env"
#define SOAP_1_1_ENC_NAMESPACE   "http://schemas.xmlsoap.org/soap/encoding/"
#define SOAP_1_1_ENC_NS_PREFIX   "SOAP-ENC"
#define SOAP_1_2_ENC_NAMESPACE   "http://www.w3.org/2003/05/soap-encoding"
#define SOAP_1_2_ENC_NS_PREFIX   "enc"
#define SCHEMA_NAMESPACE   "http://www.w3.org/2001/XMLSchema"
#define XSD_NAMESPACE   "http://www.w3.org/2001/XMLSchema"
#define XSD_NS_PREFIX   "xsd"
#define XSI_NAMESPACE   "http://www.w3.org/2001/XMLSchema-instance"
#define XSI_NS_PREFIX   "xsi"
#define XML_NAMESPACE   "http://www.w3.org/XML/1998/namespace"
#define XML_NS_PREFIX   "xml"
#define XSD_STRING   101
#define XSD_STRING_STRING   "string"
#define XSD_BOOLEAN   102
#define XSD_BOOLEAN_STRING   "boolean"
#define XSD_DECIMAL   103
#define XSD_DECIMAL_STRING   "decimal"
#define XSD_FLOAT   104
#define XSD_FLOAT_STRING   "float"
#define XSD_DOUBLE   105
#define XSD_DOUBLE_STRING   "double"
#define XSD_DURATION   106
#define XSD_DURATION_STRING   "duration"
#define XSD_DATETIME   107
#define XSD_DATETIME_STRING   "dateTime"
#define XSD_TIME   108
#define XSD_TIME_STRING   "time"
#define XSD_DATE   109
#define XSD_DATE_STRING   "date"
#define XSD_GYEARMONTH   110
#define XSD_GYEARMONTH_STRING   "gYearMonth"
#define XSD_GYEAR   111
#define XSD_GYEAR_STRING   "gYear"
#define XSD_GMONTHDAY   112
#define XSD_GMONTHDAY_STRING   "gMonthDay"
#define XSD_GDAY   113
#define XSD_GDAY_STRING   "gDay"
#define XSD_GMONTH   114
#define XSD_GMONTH_STRING   "gMonth"
#define XSD_HEXBINARY   115
#define XSD_HEXBINARY_STRING   "hexBinary"
#define XSD_BASE64BINARY   116
#define XSD_BASE64BINARY_STRING   "base64Binary"
#define XSD_ANYURI   117
#define XSD_ANYURI_STRING   "anyURI"
#define XSD_QNAME   118
#define XSD_QNAME_STRING   "QName"
#define XSD_NOTATION   119
#define XSD_NOTATION_STRING   "NOTATION"
#define XSD_NORMALIZEDSTRING   120
#define XSD_NORMALIZEDSTRING_STRING   "normalizedString"
#define XSD_TOKEN   121
#define XSD_TOKEN_STRING   "token"
#define XSD_LANGUAGE   122
#define XSD_LANGUAGE_STRING   "language"
#define XSD_NMTOKEN   123
#define XSD_NMTOKEN_STRING   "NMTOKEN"
#define XSD_NAME   124
#define XSD_NAME_STRING   "Name"
#define XSD_NCNAME   125
#define XSD_NCNAME_STRING   "NCName"
#define XSD_ID   126
#define XSD_ID_STRING   "ID"
#define XSD_IDREF   127
#define XSD_IDREF_STRING   "IDREF"
#define XSD_IDREFS   128
#define XSD_IDREFS_STRING   "IDREFS"
#define XSD_ENTITY   129
#define XSD_ENTITY_STRING   "ENTITY"
#define XSD_ENTITIES   130
#define XSD_ENTITIES_STRING   "ENTITIES"
#define XSD_INTEGER   131
#define XSD_INTEGER_STRING   "integer"
#define XSD_NONPOSITIVEINTEGER   132
#define XSD_NONPOSITIVEINTEGER_STRING   "nonPositiveInteger"
#define XSD_NEGATIVEINTEGER   133
#define XSD_NEGATIVEINTEGER_STRING   "negativeInteger"
#define XSD_LONG   134
#define XSD_LONG_STRING   "long"
#define XSD_INT   135
#define XSD_INT_STRING   "int"
#define XSD_SHORT   136
#define XSD_SHORT_STRING   "short"
#define XSD_BYTE   137
#define XSD_BYTE_STRING   "byte"
#define XSD_NONNEGATIVEINTEGER   138
#define XSD_NONNEGATIVEINTEGER_STRING   "nonNegativeInteger"
#define XSD_UNSIGNEDLONG   139
#define XSD_UNSIGNEDLONG_STRING   "unsignedLong"
#define XSD_UNSIGNEDINT   140
#define XSD_UNSIGNEDINT_STRING   "unsignedInt"
#define XSD_UNSIGNEDSHORT   141
#define XSD_UNSIGNEDSHORT_STRING   "unsignedShort"
#define XSD_UNSIGNEDBYTE   142
#define XSD_UNSIGNEDBYTE_STRING   "unsignedByte"
#define XSD_POSITIVEINTEGER   143
#define XSD_POSITIVEINTEGER_STRING   "positiveInteger"
#define XSD_NMTOKENS   144
#define XSD_NMTOKENS_STRING   "NMTOKENS"
#define XSD_ANYTYPE   145
#define XSD_ANYTYPE_STRING   "anyType"
#define XSD_UR_TYPE   146
#define XSD_UR_TYPE_STRING   "ur-type"
#define XSD_ANYXML   147
#define APACHE_NAMESPACE   "http://xml.apache.org/xml-soap"
#define APACHE_MAP   200
#define APACHE_MAP_STRING   "Map"
#define SOAP_ENC_ARRAY   300
#define SOAP_ENC_ARRAY_STRING   "Array"
#define SOAP_ENC_OBJECT   301
#define SOAP_ENC_OBJECT_STRING   "Struct"
#define WSDL_NAMESPACE   "http://schemas.xmlsoap.org/wsdl/"
#define WSDL_NS_PREFIX   "wsdl"
#define WSDL_SOAP11_NAMESPACE   "http://schemas.xmlsoap.org/wsdl/soap/"
#define WSDL_SOAP12_NAMESPACE   "http://schemas.xmlsoap.org/wsdl/soap12/"
#define RPC_SOAP12_NAMESPACE   "http://www.w3.org/2003/05/soap-rpc"
#define RPC_SOAP12_NS_PREFIX   "rpc"
#define WSDL_HTTP11_NAMESPACE   "http://schemas.xmlsoap.org/wsdl/http/"
#define WSDL_HTTP12_NAMESPACE   "http://www.w3.org/2003/05/soap/bindings/HTTP/"
#define WSDL_HTTP_NS_PREFIX   "http"
#define WSDL_HTTP_TRANSPORT   "http://schemas.xmlsoap.org/soap/http"
#define WSDL_MIME_NAMESPACE   "http://schemas.xmlsoap.org/wsdl/mime/"
#define WSDL_DIME_NAMESPACE   "http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/"
#define WSDL_DIME_OPEN   "http://schemas.xmlsoap.org/ws/2002/04/dime/open-layout"
#define WSDL_DIME_CLOSED   "http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout"
#define UNKNOWN_TYPE   999998
#define END_KNOWN_TYPES   999999

Functions

xmlNodePtr master_to_xml (encodePtr encode, zval *data, int style, xmlNodePtr parent)
zval * master_to_zval (encodePtr encode, xmlNodePtr data)
xmlNodePtr to_xml_user (encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
zval * to_zval_user (encodeTypePtr type, xmlNodePtr node)
void whiteSpace_replace (xmlChar *str)
void whiteSpace_collapse (xmlChar *str)
xmlNodePtr sdl_guess_convert_xml (encodeTypePtr enc, zval *data, int style, xmlNodePtr parent)
zval * sdl_guess_convert_zval (encodeTypePtr enc, xmlNodePtr data)
void encode_finish ()
void encode_reset_ns ()
xmlNsPtr encode_add_ns (xmlNodePtr node, const char *ns)
encodePtr get_conversion (int encode)
void delete_encoder (void *handle)
void delete_encoder_persistent (void *handle)

Variables

encode defaultEncoding []
int numDefaultEncodings

Class Documentation

struct _encodeType

Definition at line 176 of file php_encoding.h.

Class Members
soapMappingPtr map
char * ns
sdlTypePtr sdl_type
int type
char * type_str

Define Documentation

#define APACHE_MAP   200

Definition at line 145 of file php_encoding.h.

#define APACHE_MAP_STRING   "Map"

Definition at line 146 of file php_encoding.h.

#define APACHE_NAMESPACE   "http://xml.apache.org/xml-soap"

Definition at line 144 of file php_encoding.h.

#define END_KNOWN_TYPES   999999

Definition at line 174 of file php_encoding.h.

#define RPC_SOAP12_NAMESPACE   "http://www.w3.org/2003/05/soap-rpc"

Definition at line 158 of file php_encoding.h.

#define RPC_SOAP12_NS_PREFIX   "rpc"

Definition at line 159 of file php_encoding.h.

#define SCHEMA_NAMESPACE   "http://www.w3.org/2001/XMLSchema"

Definition at line 41 of file php_encoding.h.

#define SOAP_1_1_ENC_NAMESPACE   "http://schemas.xmlsoap.org/soap/encoding/"

Definition at line 35 of file php_encoding.h.

#define SOAP_1_1_ENC_NS_PREFIX   "SOAP-ENC"

Definition at line 36 of file php_encoding.h.

#define SOAP_1_1_ENV_NAMESPACE   "http://schemas.xmlsoap.org/soap/envelope/"

Definition at line 29 of file php_encoding.h.

#define SOAP_1_1_ENV_NS_PREFIX   "SOAP-ENV"

Definition at line 30 of file php_encoding.h.

#define SOAP_1_2_ENC_NAMESPACE   "http://www.w3.org/2003/05/soap-encoding"

Definition at line 38 of file php_encoding.h.

#define SOAP_1_2_ENC_NS_PREFIX   "enc"

Definition at line 39 of file php_encoding.h.

#define SOAP_1_2_ENV_NAMESPACE   "http://www.w3.org/2003/05/soap-envelope"

Definition at line 32 of file php_encoding.h.

#define SOAP_1_2_ENV_NS_PREFIX   "env"

Definition at line 33 of file php_encoding.h.

#define SOAP_ENC_ARRAY   300

Definition at line 148 of file php_encoding.h.

#define SOAP_ENC_ARRAY_STRING   "Array"

Definition at line 149 of file php_encoding.h.

#define SOAP_ENC_OBJECT   301

Definition at line 150 of file php_encoding.h.

#define SOAP_ENC_OBJECT_STRING   "Struct"

Definition at line 151 of file php_encoding.h.

#define UNKNOWN_TYPE   999998

Definition at line 173 of file php_encoding.h.

#define WSDL_DIME_CLOSED   "http://schemas.xmlsoap.org/ws/2002/04/dime/closed-layout"

Definition at line 171 of file php_encoding.h.

#define WSDL_DIME_NAMESPACE   "http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/"

Definition at line 169 of file php_encoding.h.

#define WSDL_DIME_OPEN   "http://schemas.xmlsoap.org/ws/2002/04/dime/open-layout"

Definition at line 170 of file php_encoding.h.

#define WSDL_HTTP11_NAMESPACE   "http://schemas.xmlsoap.org/wsdl/http/"

Definition at line 161 of file php_encoding.h.

#define WSDL_HTTP12_NAMESPACE   "http://www.w3.org/2003/05/soap/bindings/HTTP/"

Definition at line 162 of file php_encoding.h.

#define WSDL_HTTP_NS_PREFIX   "http"

Definition at line 163 of file php_encoding.h.

#define WSDL_HTTP_TRANSPORT   "http://schemas.xmlsoap.org/soap/http"

Definition at line 165 of file php_encoding.h.

#define WSDL_MIME_NAMESPACE   "http://schemas.xmlsoap.org/wsdl/mime/"

Definition at line 167 of file php_encoding.h.

#define WSDL_NAMESPACE   "http://schemas.xmlsoap.org/wsdl/"

Definition at line 153 of file php_encoding.h.

#define WSDL_NS_PREFIX   "wsdl"

Definition at line 154 of file php_encoding.h.

#define WSDL_SOAP11_NAMESPACE   "http://schemas.xmlsoap.org/wsdl/soap/"

Definition at line 156 of file php_encoding.h.

#define WSDL_SOAP12_NAMESPACE   "http://schemas.xmlsoap.org/wsdl/soap12/"

Definition at line 157 of file php_encoding.h.

#define XML_NAMESPACE   "http://www.w3.org/XML/1998/namespace"

Definition at line 46 of file php_encoding.h.

#define XML_NS_PREFIX   "xml"

Definition at line 47 of file php_encoding.h.

#define XSD_1999_NAMESPACE   "http://www.w3.org/1999/XMLSchema"

Definition at line 25 of file php_encoding.h.

#define XSD_1999_TIMEINSTANT   401

Definition at line 26 of file php_encoding.h.

#define XSD_1999_TIMEINSTANT_STRING   "timeInstant"

Definition at line 27 of file php_encoding.h.

#define XSD_ANYTYPE   145

Definition at line 137 of file php_encoding.h.

#define XSD_ANYTYPE_STRING   "anyType"

Definition at line 138 of file php_encoding.h.

#define XSD_ANYURI   117

Definition at line 81 of file php_encoding.h.

#define XSD_ANYURI_STRING   "anyURI"

Definition at line 82 of file php_encoding.h.

#define XSD_ANYXML   147

Definition at line 142 of file php_encoding.h.

#define XSD_BASE64BINARY   116

Definition at line 79 of file php_encoding.h.

#define XSD_BASE64BINARY_STRING   "base64Binary"

Definition at line 80 of file php_encoding.h.

#define XSD_BOOLEAN   102

Definition at line 51 of file php_encoding.h.

#define XSD_BOOLEAN_STRING   "boolean"

Definition at line 52 of file php_encoding.h.

#define XSD_BYTE   137

Definition at line 121 of file php_encoding.h.

#define XSD_BYTE_STRING   "byte"

Definition at line 122 of file php_encoding.h.

#define XSD_DATE   109

Definition at line 65 of file php_encoding.h.

#define XSD_DATE_STRING   "date"

Definition at line 66 of file php_encoding.h.

#define XSD_DATETIME   107

Definition at line 61 of file php_encoding.h.

#define XSD_DATETIME_STRING   "dateTime"

Definition at line 62 of file php_encoding.h.

#define XSD_DECIMAL   103

Definition at line 53 of file php_encoding.h.

#define XSD_DECIMAL_STRING   "decimal"

Definition at line 54 of file php_encoding.h.

#define XSD_DOUBLE   105

Definition at line 57 of file php_encoding.h.

#define XSD_DOUBLE_STRING   "double"

Definition at line 58 of file php_encoding.h.

#define XSD_DURATION   106

Definition at line 59 of file php_encoding.h.

#define XSD_DURATION_STRING   "duration"

Definition at line 60 of file php_encoding.h.

#define XSD_ENTITIES   130

Definition at line 107 of file php_encoding.h.

#define XSD_ENTITIES_STRING   "ENTITIES"

Definition at line 108 of file php_encoding.h.

#define XSD_ENTITY   129

Definition at line 105 of file php_encoding.h.

#define XSD_ENTITY_STRING   "ENTITY"

Definition at line 106 of file php_encoding.h.

#define XSD_FLOAT   104

Definition at line 55 of file php_encoding.h.

#define XSD_FLOAT_STRING   "float"

Definition at line 56 of file php_encoding.h.

#define XSD_GDAY   113

Definition at line 73 of file php_encoding.h.

#define XSD_GDAY_STRING   "gDay"

Definition at line 74 of file php_encoding.h.

#define XSD_GMONTH   114

Definition at line 75 of file php_encoding.h.

#define XSD_GMONTH_STRING   "gMonth"

Definition at line 76 of file php_encoding.h.

#define XSD_GMONTHDAY   112

Definition at line 71 of file php_encoding.h.

#define XSD_GMONTHDAY_STRING   "gMonthDay"

Definition at line 72 of file php_encoding.h.

#define XSD_GYEAR   111

Definition at line 69 of file php_encoding.h.

#define XSD_GYEAR_STRING   "gYear"

Definition at line 70 of file php_encoding.h.

#define XSD_GYEARMONTH   110

Definition at line 67 of file php_encoding.h.

#define XSD_GYEARMONTH_STRING   "gYearMonth"

Definition at line 68 of file php_encoding.h.

#define XSD_HEXBINARY   115

Definition at line 77 of file php_encoding.h.

#define XSD_HEXBINARY_STRING   "hexBinary"

Definition at line 78 of file php_encoding.h.

#define XSD_ID   126

Definition at line 99 of file php_encoding.h.

#define XSD_ID_STRING   "ID"

Definition at line 100 of file php_encoding.h.

#define XSD_IDREF   127

Definition at line 101 of file php_encoding.h.

#define XSD_IDREF_STRING   "IDREF"

Definition at line 102 of file php_encoding.h.

#define XSD_IDREFS   128

Definition at line 103 of file php_encoding.h.

#define XSD_IDREFS_STRING   "IDREFS"

Definition at line 104 of file php_encoding.h.

#define XSD_INT   135

Definition at line 117 of file php_encoding.h.

#define XSD_INT_STRING   "int"

Definition at line 118 of file php_encoding.h.

#define XSD_INTEGER   131

Definition at line 109 of file php_encoding.h.

#define XSD_INTEGER_STRING   "integer"

Definition at line 110 of file php_encoding.h.

#define XSD_LANGUAGE   122

Definition at line 91 of file php_encoding.h.

#define XSD_LANGUAGE_STRING   "language"

Definition at line 92 of file php_encoding.h.

#define XSD_LONG   134

Definition at line 115 of file php_encoding.h.

#define XSD_LONG_STRING   "long"

Definition at line 116 of file php_encoding.h.

#define XSD_NAME   124

Definition at line 95 of file php_encoding.h.

#define XSD_NAME_STRING   "Name"

Definition at line 96 of file php_encoding.h.

#define XSD_NAMESPACE   "http://www.w3.org/2001/XMLSchema"

Definition at line 42 of file php_encoding.h.

#define XSD_NCNAME   125

Definition at line 97 of file php_encoding.h.

#define XSD_NCNAME_STRING   "NCName"

Definition at line 98 of file php_encoding.h.

#define XSD_NEGATIVEINTEGER   133

Definition at line 113 of file php_encoding.h.

#define XSD_NEGATIVEINTEGER_STRING   "negativeInteger"

Definition at line 114 of file php_encoding.h.

#define XSD_NMTOKEN   123

Definition at line 93 of file php_encoding.h.

#define XSD_NMTOKEN_STRING   "NMTOKEN"

Definition at line 94 of file php_encoding.h.

#define XSD_NMTOKENS   144

Definition at line 135 of file php_encoding.h.

#define XSD_NMTOKENS_STRING   "NMTOKENS"

Definition at line 136 of file php_encoding.h.

#define XSD_NONNEGATIVEINTEGER   138

Definition at line 123 of file php_encoding.h.

#define XSD_NONNEGATIVEINTEGER_STRING   "nonNegativeInteger"

Definition at line 124 of file php_encoding.h.

#define XSD_NONPOSITIVEINTEGER   132

Definition at line 111 of file php_encoding.h.

#define XSD_NONPOSITIVEINTEGER_STRING   "nonPositiveInteger"

Definition at line 112 of file php_encoding.h.

#define XSD_NORMALIZEDSTRING   120

Definition at line 87 of file php_encoding.h.

#define XSD_NORMALIZEDSTRING_STRING   "normalizedString"

Definition at line 88 of file php_encoding.h.

#define XSD_NOTATION   119

Definition at line 85 of file php_encoding.h.

#define XSD_NOTATION_STRING   "NOTATION"

Definition at line 86 of file php_encoding.h.

#define XSD_NS_PREFIX   "xsd"

Definition at line 43 of file php_encoding.h.

#define XSD_POSITIVEINTEGER   143

Definition at line 133 of file php_encoding.h.

#define XSD_POSITIVEINTEGER_STRING   "positiveInteger"

Definition at line 134 of file php_encoding.h.

#define XSD_QNAME   118

Definition at line 83 of file php_encoding.h.

#define XSD_QNAME_STRING   "QName"

Definition at line 84 of file php_encoding.h.

#define XSD_SHORT   136

Definition at line 119 of file php_encoding.h.

#define XSD_SHORT_STRING   "short"

Definition at line 120 of file php_encoding.h.

#define XSD_STRING   101

Definition at line 49 of file php_encoding.h.

#define XSD_STRING_STRING   "string"

Definition at line 50 of file php_encoding.h.

#define XSD_TIME   108

Definition at line 63 of file php_encoding.h.

#define XSD_TIME_STRING   "time"

Definition at line 64 of file php_encoding.h.

#define XSD_TOKEN   121

Definition at line 89 of file php_encoding.h.

#define XSD_TOKEN_STRING   "token"

Definition at line 90 of file php_encoding.h.

#define XSD_UNSIGNEDBYTE   142

Definition at line 131 of file php_encoding.h.

#define XSD_UNSIGNEDBYTE_STRING   "unsignedByte"

Definition at line 132 of file php_encoding.h.

#define XSD_UNSIGNEDINT   140

Definition at line 127 of file php_encoding.h.

#define XSD_UNSIGNEDINT_STRING   "unsignedInt"

Definition at line 128 of file php_encoding.h.

#define XSD_UNSIGNEDLONG   139

Definition at line 125 of file php_encoding.h.

#define XSD_UNSIGNEDLONG_STRING   "unsignedLong"

Definition at line 126 of file php_encoding.h.

#define XSD_UNSIGNEDSHORT   141

Definition at line 129 of file php_encoding.h.

#define XSD_UNSIGNEDSHORT_STRING   "unsignedShort"

Definition at line 130 of file php_encoding.h.

#define XSD_UR_TYPE   146

Definition at line 139 of file php_encoding.h.

#define XSD_UR_TYPE_STRING   "ur-type"

Definition at line 140 of file php_encoding.h.

#define XSI_NAMESPACE   "http://www.w3.org/2001/XMLSchema-instance"

Definition at line 44 of file php_encoding.h.

#define XSI_NS_PREFIX   "xsi"

Definition at line 45 of file php_encoding.h.


Function Documentation

void delete_encoder ( void *  handle)

Definition at line 3785 of file php_encoding.c.

{
       encodePtr t = *((encodePtr*)encode);
       if (t->details.ns) {
              efree(t->details.ns);
       }
       if (t->details.type_str) {
              efree(t->details.type_str);
       }
       if (t->details.map) {
              delete_mapping(t->details.map);
       }
       efree(t);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void delete_encoder_persistent ( void *  handle)

Definition at line 3800 of file php_encoding.c.

{
       encodePtr t = *((encodePtr*)encode);
       if (t->details.ns) {
              free(t->details.ns);
       }
       if (t->details.type_str) {
              free(t->details.type_str);
       }
       /* we should never have mapping in persistent encoder */
       assert(t->details.map == NULL);
       free(t);
}

Here is the caller graph for this function:

xmlNsPtr encode_add_ns ( xmlNodePtr  node,
const char *  ns 
)

Definition at line 3536 of file php_encoding.c.

{
       xmlNsPtr xmlns;

       if (ns == NULL) {
         return NULL;
       }

       xmlns = xmlSearchNsByHref(node->doc, node, BAD_CAST(ns));
       if (xmlns != NULL && xmlns->prefix == NULL) {
              xmlns = xmlSearchNsPrefixByHref(node->doc, node, BAD_CAST(ns));
       }
       if (xmlns == NULL) {
              xmlChar* prefix;
              TSRMLS_FETCH();

              if (zend_hash_find(&SOAP_GLOBAL(defEncNs), (char*)ns, strlen(ns) + 1, (void **)&prefix) == SUCCESS) {
                     xmlns = xmlNewNs(node->doc->children, BAD_CAST(ns), prefix);
              } else {
                     smart_str prefix = {0};
                     int num = ++SOAP_GLOBAL(cur_uniq_ns);

                     while (1) {
                            smart_str_appendl(&prefix, "ns", 2);
                            smart_str_append_long(&prefix, num);
                            smart_str_0(&prefix);
                            if (xmlSearchNs(node->doc, node, BAD_CAST(prefix.c)) == NULL) {
                                   break;
                            }
                            smart_str_free(&prefix);
                            prefix.c = NULL;
                            prefix.len = 0;
                            num = ++SOAP_GLOBAL(cur_uniq_ns);
                     }

                     xmlns = xmlNewNs(node->doc->children, BAD_CAST(ns), BAD_CAST(prefix.c));
                     smart_str_free(&prefix);
              }
       }
       return xmlns;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void encode_finish ( )

Definition at line 3606 of file php_encoding.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void encode_reset_ns ( )

Definition at line 3593 of file php_encoding.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3618 of file php_encoding.c.

{
       encodePtr *enc = NULL;
       TSRMLS_FETCH();

       if (zend_hash_index_find(&SOAP_GLOBAL(defEncIndex), encode, (void **)&enc) == FAILURE) {
              soap_error0(E_ERROR,  "Encoding: Cannot find encoding");
              return NULL;
       } else {
              return *enc;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

xmlNodePtr master_to_xml ( encodePtr  encode,
zval *  data,
int  style,
xmlNodePtr  parent 
)

Definition at line 531 of file php_encoding.c.

{
       return master_to_xml_int(encode, data, style, parent, 1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

zval* master_to_zval ( encodePtr  encode,
xmlNodePtr  data 
)

Definition at line 588 of file php_encoding.c.

{
       TSRMLS_FETCH();
       data = check_and_resolve_href(data);

       if (encode == NULL) {
              encode = get_conversion(UNKNOWN_TYPE);
       } else {
              /* Use xsi:type if it is defined */
              xmlAttrPtr type_attr = get_attribute_ex(data->properties,"type", XSI_NAMESPACE);

              if (type_attr != NULL) {
                     encodePtr  enc = get_encoder_from_prefix(SOAP_GLOBAL(sdl), data, type_attr->children->content);

                     if (enc != NULL && enc != encode) {
                       encodePtr tmp = enc;
                       while (tmp &&
                              tmp->details.sdl_type != NULL &&
                              tmp->details.sdl_type->kind != XSD_TYPEKIND_COMPLEX) {
                         if (enc == tmp->details.sdl_type->encode ||
                             tmp == tmp->details.sdl_type->encode) {
                            enc = NULL;
                            break;
                         }
                         tmp = tmp->details.sdl_type->encode;
                       }
                       if (enc != NULL) {
                         encode = enc;
                       }
                     }
              }
       }
       return master_to_zval_int(encode, data);
}

Here is the call graph for this function:

Here is the caller graph for this function:

xmlNodePtr sdl_guess_convert_xml ( encodeTypePtr  enc,
zval *  data,
int  style,
xmlNodePtr  parent 
)

Definition at line 3367 of file php_encoding.c.

{
       sdlTypePtr type;
       xmlNodePtr ret = NULL;

       type = enc->sdl_type;

       if (type == NULL) {
              ret = guess_xml_convert(enc, data, style, parent);
              if (style == SOAP_ENCODED) {
                     set_ns_and_type(ret, enc);
              }
              return ret;
       }
/*FIXME: restriction support
       if (type) {
              if (type->restrictions && Z_TYPE_P(data) == IS_STRING) {
                     if (type->restrictions->enumeration) {
                            if (!zend_hash_exists(type->restrictions->enumeration,Z_STRVAL_P(data),Z_STRLEN_P(data)+1)) {
                                   soap_error1(E_WARNING, "Encoding: Restriction: invalid enumeration value \"%s\".", Z_STRVAL_P(data));
                            }
                     }
                     if (type->restrictions->minLength &&
                         Z_STRLEN_P(data) < type->restrictions->minLength->value) {
                     soap_error0(E_WARNING, "Encoding: Restriction: length less than 'minLength'");
                     }
                     if (type->restrictions->maxLength &&
                         Z_STRLEN_P(data) > type->restrictions->maxLength->value) {
                     soap_error0(E_WARNING, "Encoding: Restriction: length greater than 'maxLength'");
                     }
                     if (type->restrictions->length &&
                         Z_STRLEN_P(data) != type->restrictions->length->value) {
                     soap_error0(E_WARNING, "Encoding: Restriction: length is not equal to 'length'");
                     }
              }
       }
*/
       switch(type->kind) {
              case XSD_TYPEKIND_SIMPLE:
                     if (type->encode && enc != &type->encode->details) {
                            ret = master_to_xml(type->encode, data, style, parent);
                     } else {
                            ret = guess_xml_convert(enc, data, style, parent);
                     }
                     break;
              case XSD_TYPEKIND_LIST:
                     ret = to_xml_list(enc, data, style, parent);
                     break;
              case XSD_TYPEKIND_UNION:
                     ret = to_xml_union(enc, data, style, parent);
                     break;
              case XSD_TYPEKIND_COMPLEX:
              case XSD_TYPEKIND_RESTRICTION:
              case XSD_TYPEKIND_EXTENSION:
                     if (type->encode &&
                         (type->encode->details.type == IS_ARRAY ||
                          type->encode->details.type == SOAP_ENC_ARRAY)) {
                            return to_xml_array(enc, data, style, parent);
                     } else {
                            return to_xml_object(enc, data, style, parent);
                     }
                     break;
              default:
              soap_error0(E_ERROR, "Encoding: Internal Error");
                     break;
       }
       if (style == SOAP_ENCODED) {
              set_ns_and_type(ret, enc);
       }
       return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

zval* sdl_guess_convert_zval ( encodeTypePtr  enc,
xmlNodePtr  data 
)

Definition at line 3303 of file php_encoding.c.

{
       sdlTypePtr type;

       type = enc->sdl_type;
       if (type == NULL) {
              return guess_zval_convert(enc, data);
       }
/*FIXME: restriction support
       if (type && type->restrictions &&
           data &&  data->children && data->children->content) {
              if (type->restrictions->whiteSpace && type->restrictions->whiteSpace->value) {
                     if (strcmp(type->restrictions->whiteSpace->value,"replace") == 0) {
                            whiteSpace_replace(data->children->content);
                     } else if (strcmp(type->restrictions->whiteSpace->value,"collapse") == 0) {
                            whiteSpace_collapse(data->children->content);
                     }
              }
              if (type->restrictions->enumeration) {
                     if (!zend_hash_exists(type->restrictions->enumeration,data->children->content,strlen(data->children->content)+1)) {
                            soap_error1(E_WARNING, "Encoding: Restriction: invalid enumeration value \"%s\"", data->children->content);
                     }
              }
              if (type->restrictions->minLength &&
                  strlen(data->children->content) < type->restrictions->minLength->value) {
                soap_error0(E_WARNING, "Encoding: Restriction: length less than 'minLength'");
              }
              if (type->restrictions->maxLength &&
                  strlen(data->children->content) > type->restrictions->maxLength->value) {
                soap_error0(E_WARNING, "Encoding: Restriction: length greater than 'maxLength'");
              }
              if (type->restrictions->length &&
                  strlen(data->children->content) != type->restrictions->length->value) {
                soap_error0(E_WARNING, "Encoding: Restriction: length is not equal to 'length'");
              }
       }
*/
       switch (type->kind) {
              case XSD_TYPEKIND_SIMPLE:
                     if (type->encode && enc != &type->encode->details) {
                            return master_to_zval_int(type->encode, data);
                     } else {
                            return guess_zval_convert(enc, data);
                     }
                     break;
              case XSD_TYPEKIND_LIST:
                     return to_zval_list(enc, data);
              case XSD_TYPEKIND_UNION:
                     return to_zval_union(enc, data);
              case XSD_TYPEKIND_COMPLEX:
              case XSD_TYPEKIND_RESTRICTION:
              case XSD_TYPEKIND_EXTENSION:
                     if (type->encode &&
                         (type->encode->details.type == IS_ARRAY ||
                          type->encode->details.type == SOAP_ENC_ARRAY)) {
                            return to_zval_array(enc, data);
                     }
                     return to_zval_object(enc, data);
              default:
              soap_error0(E_ERROR, "Encoding: Internal Error");
                     return guess_zval_convert(enc, data);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

xmlNodePtr to_xml_user ( encodeTypePtr  type,
zval *  data,
int  style,
xmlNodePtr  parent 
)

Definition at line 623 of file php_encoding.c.

{
       xmlNodePtr ret = NULL;
       zval *return_value;
       TSRMLS_FETCH();

       if (type && type->map && type->map->to_xml) {
              MAKE_STD_ZVAL(return_value);

              if (call_user_function(EG(function_table), NULL, type->map->to_xml, return_value, 1, &data TSRMLS_CC) == FAILURE) {
                     soap_error0(E_ERROR, "Encoding: Error calling to_xml callback");
              }
              if (Z_TYPE_P(return_value) == IS_STRING) {              
                     xmlDocPtr doc = soap_xmlParseMemory(Z_STRVAL_P(return_value), Z_STRLEN_P(return_value));
                     if (doc && doc->children) {                      
                            ret = xmlDocCopyNode(doc->children, parent->doc, 1);
                     }
                     xmlFreeDoc(doc);
              }

              zval_ptr_dtor(&return_value);
       }
       if (!ret) {
              ret = xmlNewNode(NULL, BAD_CAST("BOGUS"));
       }
       xmlAddChild(parent, ret);
       if (style == SOAP_ENCODED) {
              set_ns_and_type(ret, type);
       }
       return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

zval* to_zval_user ( encodeTypePtr  type,
xmlNodePtr  node 
)

Definition at line 655 of file php_encoding.c.

{
       zval *return_value;
       TSRMLS_FETCH();

       if (type && type->map && type->map->to_zval) {
              xmlBufferPtr buf;
              zval *data;
              xmlNodePtr copy;

              copy = xmlCopyNode(node, 1);
              buf = xmlBufferCreate();
              xmlNodeDump(buf, NULL, copy, 0, 0);
              MAKE_STD_ZVAL(data);
              ZVAL_STRING(data, (char*)xmlBufferContent(buf), 1);
              xmlBufferFree(buf);
              xmlFreeNode(copy);

              ALLOC_INIT_ZVAL(return_value);
              
              if (call_user_function(EG(function_table), NULL, type->map->to_zval, return_value, 1, &data TSRMLS_CC) == FAILURE) {
                     soap_error0(E_ERROR, "Encoding: Error calling from_xml callback");
              }
              zval_ptr_dtor(&data);
       } else {
              ALLOC_INIT_ZVAL(return_value);
       }
       return return_value;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void whiteSpace_collapse ( xmlChar *  str)

Definition at line 252 of file php_encoding.c.

{
       xmlChar *pos;
       xmlChar old;

       pos = str;
       whiteSpace_replace(str);
       while (*str == ' ') {
              str++;
       }
       old = '\0';
       while (*str != '\0') {
              if (*str != ' ' || old != ' ') {
                     *pos = *str;
                     pos++;
              }
              old = *str;
              str++;
       }
       if (old == ' ') {
              --pos;
       }
       *pos = '\0';
}

Here is the call graph for this function:

Here is the caller graph for this function:

void whiteSpace_replace ( xmlChar *  str)

Definition at line 242 of file php_encoding.c.

{
       while (*str != '\0') {
              if (*str == '\x9' || *str == '\xA' || *str == '\xD') {
                     *str = ' ';
              }
              str++;
       }
}

Here is the caller graph for this function:


Variable Documentation

encode defaultEncoding[]

Definition at line 147 of file php_encoding.c.

Definition at line 239 of file php_encoding.c.