ILIAS
Release_4_1_x_branch Revision 61804
|
parses an XML Schema, allows access to it's data, other utility methods. More...
Public Member Functions | |
nusoap_xmlschema ($schema='', $xml='', $namespaces=array()) | |
constructor | |
parseFile ($xml, $type) | |
parse an XML file | |
parseString ($xml, $type) | |
parse an XML string | |
CreateTypeName ($ename) | |
gets a type name for an unnamed type | |
schemaStartElement ($parser, $name, $attrs) | |
start-element handler | |
schemaEndElement ($parser, $name) | |
end-element handler | |
schemaCharacterData ($parser, $data) | |
element content handler | |
serializeSchema () | |
serialize the schema | |
xdebug ($string) | |
adds debug data to the clas level debug string | |
getPHPType ($type, $ns) | |
get the PHP type of a user defined type in the schema PHP type is kind of a misnomer since it actually returns 'struct' for assoc. | |
getTypeDef ($type) | |
returns an associative array of information about a given type returns false if no type exists by the given name | |
serializeTypeDef ($type) | |
returns a sample serialization of a given type, or false if no type by the given name | |
typeToForm ($name, $type) | |
returns HTML form elements that allow a user to enter values for creating an instance of the given type. | |
addComplexType ($name, $typeClass='complexType', $phpType='array', $compositor='', $restrictionBase='', $elements=array(), $attrs=array(), $arrayType='') | |
adds a complex type to the schema | |
addSimpleType ($name, $restrictionBase='', $typeClass='simpleType', $phpType='scalar', $enumeration=array()) | |
adds a simple type to the schema | |
addElement ($attrs) | |
adds an element to the schema | |
Public Member Functions inherited from nusoap_base | |
debug ($string) | |
adds debug data to the class level debug string | |
expandEntities ($val) | |
expands entities, e.g. | |
getError () | |
returns error string if present | |
setError ($str) | |
sets error string | |
isArraySimpleOrStruct ($val) | |
detect if array is a simple array or a struct (associative array) | |
serialize_val ($val, $name=false, $type=false, $name_ns=false, $type_ns=false, $attributes=false, $use='encoded') | |
serializes PHP values in accordance w/ section 5. | |
serializeEnvelope ($body, $headers=false, $namespaces=array(), $style='rpc', $use='encoded') | |
serialize message | |
formatDump ($str) | |
contractQname ($qname) | |
contracts a qualified name | |
expandQname ($qname) | |
expands a qualified name | |
getLocalPart ($str) | |
returns the local part of a prefixed string returns the original string, if not prefixed | |
getPrefix ($str) | |
returns the prefix part of a prefixed string returns false, if not prefixed | |
getNamespaceFromPrefix ($prefix) | |
pass it a prefix, it returns a namespace returns false if no namespace registered with the given prefix | |
getPrefixFromNamespace ($ns) | |
returns the prefix for a given namespace (or prefix) or false if no prefixes registered for the given namespace | |
varDump ($data) | |
nusoap_base () | |
constructor | |
getGlobalDebugLevel () | |
gets the global debug level, which applies to future instances | |
setGlobalDebugLevel ($level) | |
sets the global debug level, which applies to future instances | |
getDebugLevel () | |
gets the debug level for this instance | |
setDebugLevel ($level) | |
sets the debug level for this instance | |
debug ($string) | |
adds debug data to the instance debug string with formatting | |
appendDebug ($string) | |
adds debug data to the instance debug string without formatting | |
clearDebug () | |
clears the current debug data for this instance | |
& | getDebug () |
gets the current debug data for this instance | |
& | getDebugAsXMLComment () |
gets the current debug data for this instance as an XML comment this may change the contents of the debug data | |
expandEntities ($val) | |
expands entities, e.g. | |
getError () | |
returns error string if present | |
setError ($str) | |
sets error string | |
isArraySimpleOrStruct ($val) | |
detect if array is a simple array or a struct (associative array) | |
serialize_val ($val, $name=false, $type=false, $name_ns=false, $type_ns=false, $attributes=false, $use='encoded', $soapval=false) | |
serializes PHP values in accordance w/ section 5. | |
serializeEnvelope ($body, $headers=false, $namespaces=array(), $style='rpc', $use='encoded', $encodingStyle='http://schemas.xmlsoap.org/soap/encoding/') | |
serializes a message | |
formatDump ($str) | |
formats a string to be inserted into an HTML stream | |
contractQname ($qname) | |
contracts (changes namespace to prefix) a qualified name | |
expandQname ($qname) | |
expands (changes prefix to namespace) a qualified name | |
getLocalPart ($str) | |
returns the local part of a prefixed string returns the original string, if not prefixed | |
getPrefix ($str) | |
returns the prefix part of a prefixed string returns false, if not prefixed | |
getNamespaceFromPrefix ($prefix) | |
pass it a prefix, it returns a namespace | |
getPrefixFromNamespace ($ns) | |
returns the prefix for a given namespace (or prefix) or false if no prefixes registered for the given namespace | |
getmicrotime () | |
returns the time in ODBC canonical form with microseconds | |
varDump ($data) | |
Returns a string with the output of var_dump. | |
__toString () | |
represents the object as a string |
Data Fields | |
$schema = '' | |
$xml = '' | |
$enclosingNamespaces | |
$schemaInfo = array() | |
$schemaTargetNamespace = '' | |
$attributes = array() | |
$complexTypes = array() | |
$complexTypeStack = array() | |
$currentComplexType = null | |
$elements = array() | |
$elementStack = array() | |
$currentElement = null | |
$simpleTypes = array() | |
$simpleTypeStack = array() | |
$currentSimpleType = null | |
$imports = array() | |
$parser | |
$position = 0 | |
$depth = 0 | |
$depth_array = array() | |
$message = array() | |
$defaultNamespace = array() | |
Data Fields inherited from nusoap_base | |
$title = 'NuSOAP' | |
$version = '0.6.7' | |
$revision = '$Revision: 11808 $' | |
$error_str = false | |
$debug_str = '' | |
$charencoding = true | |
$XMLSchemaVersion = 'http://www.w3.org/2001/XMLSchema' | |
$soap_defencoding = 'UTF-8' | |
$namespaces | |
$usedNamespaces = array() | |
$typemap | |
$xmlEntities | |
$debugLevel |
parses an XML Schema, allows access to it's data, other utility methods.
imperfect, no validation... yet, but quite functional.
public
Definition at line 1086 of file nusoap.php.
nusoap_xmlschema::addComplexType | ( | $name, | |
$typeClass = 'complexType' , |
|||
$phpType = 'array' , |
|||
$compositor = '' , |
|||
$restrictionBase = '' , |
|||
$elements = array() , |
|||
$attrs = array() , |
|||
$arrayType = '' |
|||
) |
adds a complex type to the schema
example: array
addType( 'ArrayOfstring', 'complexType', 'array', '', 'SOAP-ENC:Array', array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'string[]'), 'xsd:string' );
example: PHP associative array ( SOAP Struct )
addType( 'SOAPStruct', 'complexType', 'struct', 'all', array('myVar'=> array('name'=>'myVar','type'=>'string') );
name | |
typeClass | (complexType|simpleType|attribute) |
phpType,: | currently supported are array and struct (php assoc array) |
compositor | (all|sequence|choice) |
restrictionBase | namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array) |
elements | = array ( name = array(name=>'',type=>'') ) |
attrs | = array( array( 'ref' => "http://schemas.xmlsoap.org/soap/encoding/:arrayType", "http://schemas.xmlsoap.org/wsdl/:arrayType" => "string[]" ) ) |
arrayType,: | namespace:name (http://www.w3.org/2001/XMLSchema:string) public |
Reimplemented in XMLSchema.
Definition at line 1942 of file nusoap.php.
References $elements, nusoap_base\appendDebug(), nusoap_base\varDump(), and xdebug().
nusoap_xmlschema::addElement | ( | $attrs | ) |
adds an element to the schema
array | $attrs | attributes that must include name and type |
Definition at line 1990 of file nusoap.php.
References nusoap_base\appendDebug(), nusoap_base\getPrefix(), nusoap_base\varDump(), and xdebug().
nusoap_xmlschema::addSimpleType | ( | $name, | |
$restrictionBase = '' , |
|||
$typeClass = 'simpleType' , |
|||
$phpType = 'scalar' , |
|||
$enumeration = array() |
|||
) |
adds a simple type to the schema
string | $name | |
string | $restrictionBase | namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array) |
string | $typeClass | (should always be simpleType) |
string | $phpType | (should always be scalar) |
array | $enumeration | array of values public |
Definition at line 1970 of file nusoap.php.
References nusoap_base\appendDebug(), nusoap_base\varDump(), and xdebug().
nusoap_xmlschema::CreateTypeName | ( | $ename | ) |
gets a type name for an unnamed type
string | Element name |
Definition at line 1231 of file nusoap.php.
Referenced by schemaStartElement().
nusoap_xmlschema::getPHPType | ( | $type, | |
$ns | |||
) |
get the PHP type of a user defined type in the schema PHP type is kind of a misnomer since it actually returns 'struct' for assoc.
arrays returns false if no type exists, or not w/ the given namespace else returns a string that is either a native php type, or 'struct'
string | $type | name of defined type |
string | $ns | namespace of type |
Reimplemented in XMLSchema.
Definition at line 1725 of file nusoap.php.
nusoap_xmlschema::getTypeDef | ( | $type | ) |
returns an associative array of information about a given type returns false if no type exists by the given name
For a complexType typeDef = array( 'restrictionBase' => '', 'phpType' => '', 'compositor' => '(sequence|all)', 'elements' => array(), // refs to elements array 'attrs' => array() // refs to attributes array ... and so on (see addComplexType) ) For simpleType or element, the array has different keys.
string | $type |
Reimplemented in XMLSchema.
Definition at line 1758 of file nusoap.php.
References nusoap_base\varDump(), and xdebug().
Referenced by serializeTypeDef(), and typeToForm().
nusoap_xmlschema::nusoap_xmlschema | ( | $schema = '' , |
|
$xml = '' , |
|||
$namespaces = array() |
|||
) |
constructor
string | $schema | schema document URI |
string | $xml | xml document URI |
string | $namespaces | namespaces defined in enclosing XML public |
Definition at line 1125 of file nusoap.php.
References nusoap_base\$namespaces, $schema, $xml, nusoap_base\debug(), nusoap_base\nusoap_base(), and parseFile().
nusoap_xmlschema::parseFile | ( | $xml, | |
$type | |||
) |
parse an XML file
string | $xml | path/URL to XML file |
string | $type | (schema | xml) |
Reimplemented in XMLSchema.
Definition at line 1158 of file nusoap.php.
References $xml, nusoap_base\debug(), parseString(), and nusoap_base\setError().
Referenced by nusoap_xmlschema().
nusoap_xmlschema::parseString | ( | $xml, | |
$type | |||
) |
parse an XML string
@param string $xml path or URL
string | $type | (schema|xml) private |
Reimplemented in XMLSchema.
Definition at line 1184 of file nusoap.php.
References $xml, nusoap_base\debug(), and nusoap_base\setError().
Referenced by parseFile().
nusoap_xmlschema::schemaCharacterData | ( | $parser, | |
$data | |||
) |
element content handler
string | $parser | XML parser object |
string | $data | element content private |
Reimplemented in XMLSchema.
Definition at line 1581 of file nusoap.php.
References $data.
nusoap_xmlschema::schemaEndElement | ( | $parser, | |
$name | |||
) |
end-element handler
string | $parser | XML parser object |
string | $name | element name private |
Reimplemented in XMLSchema.
Definition at line 1544 of file nusoap.php.
References $depth, nusoap_base\getLocalPart(), nusoap_base\getPrefix(), and xdebug().
nusoap_xmlschema::schemaStartElement | ( | $parser, | |
$name, | |||
$attrs | |||
) |
start-element handler
string | $parser | XML parser object |
string | $name | element name |
string | $attrs | associative array of attributes private |
Reimplemented in XMLSchema.
Definition at line 1247 of file nusoap.php.
References $currentComplexType, $currentSimpleType, $depth, nusoap_base\appendDebug(), CreateTypeName(), nusoap_base\expandQname(), nusoap_base\getLocalPart(), nusoap_base\getNamespaceFromPrefix(), nusoap_base\getPrefix(), nusoap_base\getPrefixFromNamespace(), nusoap_base\varDump(), and xdebug().
nusoap_xmlschema::serializeSchema | ( | ) |
serialize the schema
public
Reimplemented in XMLSchema.
Definition at line 1591 of file nusoap.php.
References $xml, and nusoap_base\getPrefixFromNamespace().
nusoap_xmlschema::serializeTypeDef | ( | $type | ) |
returns a sample serialization of a given type, or false if no type by the given name
string | $type | name of type |
Reimplemented in XMLSchema.
Definition at line 1834 of file nusoap.php.
References $data, and getTypeDef().
nusoap_xmlschema::typeToForm | ( | $name, | |
$type | |||
) |
returns HTML form elements that allow a user to enter values for creating an instance of the given type.
string | $name | name for type instance |
string | $type | name of type |
Reimplemented in XMLSchema.
Definition at line 1870 of file nusoap.php.
References getTypeDef().
nusoap_xmlschema::xdebug | ( | $string | ) |
adds debug data to the clas level debug string
string | $string | debug data private |
Reimplemented in XMLSchema.
Definition at line 1709 of file nusoap.php.
References nusoap_base\debug().
Referenced by addComplexType(), addElement(), addSimpleType(), getTypeDef(), schemaEndElement(), and schemaStartElement().
nusoap_xmlschema::$attributes = array() |
Definition at line 1097 of file nusoap.php.
nusoap_xmlschema::$complexTypes = array() |
Definition at line 1098 of file nusoap.php.
nusoap_xmlschema::$complexTypeStack = array() |
Definition at line 1099 of file nusoap.php.
nusoap_xmlschema::$currentComplexType = null |
Definition at line 1100 of file nusoap.php.
Referenced by schemaStartElement().
nusoap_xmlschema::$currentElement = null |
Definition at line 1103 of file nusoap.php.
nusoap_xmlschema::$currentSimpleType = null |
Definition at line 1106 of file nusoap.php.
Referenced by schemaStartElement().
nusoap_xmlschema::$defaultNamespace = array() |
Definition at line 1115 of file nusoap.php.
nusoap_xmlschema::$depth = 0 |
Definition at line 1112 of file nusoap.php.
Referenced by schemaEndElement(), and schemaStartElement().
nusoap_xmlschema::$depth_array = array() |
Definition at line 1113 of file nusoap.php.
nusoap_xmlschema::$elements = array() |
Definition at line 1101 of file nusoap.php.
Referenced by addComplexType().
nusoap_xmlschema::$elementStack = array() |
Definition at line 1102 of file nusoap.php.
nusoap_xmlschema::$enclosingNamespaces |
Definition at line 1092 of file nusoap.php.
nusoap_xmlschema::$imports = array() |
Definition at line 1108 of file nusoap.php.
nusoap_xmlschema::$message = array() |
Definition at line 1114 of file nusoap.php.
nusoap_xmlschema::$parser |
Definition at line 1110 of file nusoap.php.
nusoap_xmlschema::$position = 0 |
Definition at line 1111 of file nusoap.php.
nusoap_xmlschema::$schema = '' |
Definition at line 1089 of file nusoap.php.
Referenced by nusoap_xmlschema().
nusoap_xmlschema::$schemaInfo = array() |
Definition at line 1094 of file nusoap.php.
nusoap_xmlschema::$schemaTargetNamespace = '' |
Definition at line 1095 of file nusoap.php.
nusoap_xmlschema::$simpleTypes = array() |
Definition at line 1104 of file nusoap.php.
nusoap_xmlschema::$simpleTypeStack = array() |
Definition at line 1105 of file nusoap.php.
nusoap_xmlschema::$xml = '' |
Definition at line 1090 of file nusoap.php.
Referenced by nusoap_xmlschema(), parseFile(), parseString(), and serializeSchema().