Inheritance diagram for XMLSchema:
Public Member Functions | |
| XMLSchema ($schema='', $xml='', $namespaces=array()) | |
| parseFile ($xml, $type) | |
| parseString ($xml, $type) | |
| schemaStartElement ($parser, $name, $attrs) | |
| schemaEndElement ($parser, $name) | |
| schemaCharacterData ($parser, $data) | |
| serializeSchema () | |
| xdebug ($string) | |
| getPHPType ($type, $ns) | |
| getTypeDef ($type) | |
| serializeTypeDef ($type) | |
| typeToForm ($name, $type) | |
| addComplexType ($name, $typeClass='complexType', $phpType='array', $compositor='', $restrictionBase='', $elements=array(), $attrs=array(), $arrayType='') | |
| addSimpleType ($name, $restrictionBase='', $typeClass='simpleType', $phpType='scalar', $enumeration=array()) | |
| addElement ($attrs) | |
| XMLSchema ($schema='', $xml='', $namespaces=array()) | |
| parseFile ($xml, $type) | |
| parseString ($xml, $type) | |
| schemaStartElement ($parser, $name, $attrs) | |
| schemaEndElement ($parser, $name) | |
| schemaCharacterData ($parser, $data) | |
| serializeSchema () | |
| xdebug ($string) | |
| getPHPType ($type, $ns) | |
| getTypeDef ($type) | |
| serializeTypeDef ($type) | |
| typeToForm ($name, $type) | |
| addComplexType ($name, $typeClass='complexType', $phpType='array', $compositor='', $restrictionBase='', $elements=array(), $attrs=array(), $arrayType='') | |
| addSimpleType ($name, $restrictionBase='', $typeClass='simpleType', $phpType='scalar', $enumeration=array()) | |
| addElement ($attrs) | |
| XMLSchema::XMLSchema | ( | $ | schema = '', |
|
| $ | xml = '', |
|||
| $ | namespaces = array() | |||
| ) |
constructor
| string | $schema schema document URI | |
| string | $xml xml document URI | |
| string | $namespaces namespaces defined in enclosing XML public |
| XMLSchema::parseFile | ( | $ | xml, | |
| $ | type | |||
| ) |
parse an XML file
| string | $xml, path/URL to XML file | |
| string | $type, (schema | xml) |
| XMLSchema::parseString | ( | $ | xml, | |
| $ | type | |||
| ) |
parse an XML string
| string | $xml path or URL | |
| string | $type, (schema|xml) private |
| XMLSchema::schemaStartElement | ( | $ | parser, | |
| $ | name, | |||
| $ | attrs | |||
| ) |
start-element handler
| string | $parser XML parser object | |
| string | $name element name | |
| string | $attrs associative array of attributes private |
| XMLSchema::schemaEndElement | ( | $ | parser, | |
| $ | name | |||
| ) |
end-element handler
| string | $parser XML parser object | |
| string | $name element name private |
| XMLSchema::schemaCharacterData | ( | $ | parser, | |
| $ | data | |||
| ) |
element content handler
| string | $parser XML parser object | |
| string | $data element content private |
| XMLSchema::serializeSchema | ( | ) |
serialize the schema
public
| XMLSchema::xdebug | ( | $ | string | ) |
adds debug data to the clas level debug string
| string | $string debug data private |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| XMLSchema::addElement | ( | $ | attrs | ) |
adds an element to the schema
| array | $attrs attributes that must include name and type |
| XMLSchema::XMLSchema | ( | $ | schema = '', |
|
| $ | xml = '', |
|||
| $ | namespaces = array() | |||
| ) |
constructor
| string | $schema schema document URI | |
| string | $xml xml document URI | |
| string | $namespaces namespaces defined in enclosing XML public |
| XMLSchema::parseFile | ( | $ | xml, | |
| $ | type | |||
| ) |
parse an XML file
| string | $xml, path/URL to XML file | |
| string | $type, (schema | xml) |
| XMLSchema::parseString | ( | $ | xml, | |
| $ | type | |||
| ) |
parse an XML string
| string | $xml path or URL | |
| string | $type, (schema|xml) private |
| XMLSchema::schemaStartElement | ( | $ | parser, | |
| $ | name, | |||
| $ | attrs | |||
| ) |
start-element handler
| string | $parser XML parser object | |
| string | $name element name | |
| string | $attrs associative array of attributes private |
| XMLSchema::schemaEndElement | ( | $ | parser, | |
| $ | name | |||
| ) |
end-element handler
| string | $parser XML parser object | |
| string | $name element name private |
| XMLSchema::schemaCharacterData | ( | $ | parser, | |
| $ | data | |||
| ) |
element content handler
| string | $parser XML parser object | |
| string | $data element content private |
| XMLSchema::serializeSchema | ( | ) |
serialize the schema
public
| XMLSchema::xdebug | ( | $ | string | ) |
adds debug data to the clas level debug string
| string | $string debug data private |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| XMLSchema::addElement | ( | $ | attrs | ) |
adds an element to the schema
| array | $attrs attributes that must include name and type |
1.5.1