Documentation TYPO3 par Ameos

XMLSchema Class Reference

Inheritance diagram for XMLSchema:
[legend]
Collaboration diagram for XMLSchema:
[legend]
List of all members.

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)

Public Attributes

 $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()

Detailed Description

parses an XML Schema, allows access to it's data, other utility methods no validation... yet. very experimental and limited. As is discussed on XML-DEV, I'm one of the people that just doesn't have time to read the spec(s) thoroughly, and just have a couple of trusty tutorials I refer to :)

Author:
Dietrich Ayala <dietrich@ganx4.com>
Version:
Id
class.nusoap.php 1421 2006-04-10 09:27:15Z mundaun
public

Definition at line 993 of file class.nusoap.php.


Member Function Documentation

XMLSchema::XMLSchema ( schema = '',
xml = '',
namespaces = array() 
)

constructor

Parameters:
string $schema schema document URI
string $xml xml document URI
string $namespaces namespaces defined in enclosing XML public

Definition at line 1032 of file class.nusoap.php.

References nusoap_base::$namespaces, $schema, $xml, nusoap_base::debug(), and parseFile().

XMLSchema::parseFile ( xml,
type 
)

parse an XML file

Parameters:
string $xml, path/URL to XML file
string $type, (schema | xml)
Returns:
boolean public

Definition at line 1065 of file class.nusoap.php.

References $xml, nusoap_base::debug(), parseString(), and nusoap_base::setError().

Referenced by XMLSchema().

XMLSchema::parseString ( xml,
type 
)

parse an XML string

Parameters:
string $xml path or URL
string $type, (schema|xml) private

Definition at line 1091 of file class.nusoap.php.

References $xml, nusoap_base::debug(), schemaCharacterData(), schemaEndElement(), schemaStartElement(), and nusoap_base::setError().

Referenced by parseFile().

XMLSchema::schemaStartElement ( parser,
name,
attrs 
)

start-element handler

Parameters:
string $parser XML parser object
string $name element name
string $attrs associative array of attributes private

Definition at line 1139 of file class.nusoap.php.

References $depth, nusoap_base::expandQname(), nusoap_base::getLocalPart(), nusoap_base::getPrefix(), and nusoap_base::getPrefixFromNamespace().

Referenced by parseString().

XMLSchema::schemaEndElement ( parser,
name 
)

end-element handler

Parameters:
string $parser XML parser object
string $name element name private

Definition at line 1434 of file class.nusoap.php.

Referenced by parseString().

XMLSchema::schemaCharacterData ( parser,
data 
)

element content handler

Parameters:
string $parser XML parser object
string $data element content private

Definition at line 1471 of file class.nusoap.php.

Referenced by parseString().

XMLSchema::serializeSchema (  ) 

serialize the schema

public

Definition at line 1481 of file class.nusoap.php.

XMLSchema::xdebug ( string  ) 

adds debug data to the clas level debug string

Parameters:
string $string debug data private

Definition at line 1593 of file class.nusoap.php.

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'

Parameters:
string $type, name of defined type
string $ns, namespace of type
Returns:
mixed public
Deprecated:

Definition at line 1609 of file class.nusoap.php.

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.

Parameters:
string 
Returns:
mixed public
See also:
addComplexType

addSimpleType

addElement

Definition at line 1642 of file class.nusoap.php.

XMLSchema::serializeTypeDef ( type  ) 

returns a sample serialization of a given type, or false if no type by the given name

Parameters:
string $type, name of type
Returns:
mixed public
Deprecated:

Definition at line 1711 of file class.nusoap.php.

XMLSchema::typeToForm ( name,
type 
)

returns HTML form elements that allow a user to enter values for creating an instance of the given type.

Parameters:
string $name, name for type instance
string $type, name of type
Returns:
string public
Deprecated:

Definition at line 1747 of file class.nusoap.php.

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') );

Parameters:
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
See also:
getTypeDef

Definition at line 1819 of file class.nusoap.php.

XMLSchema::addSimpleType ( name,
restrictionBase = '',
typeClass = 'simpleType',
phpType = 'scalar',
enumeration = array() 
)

adds a simple type to the schema

Parameters:
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
See also:
xmlschema

getTypeDef

Definition at line 1847 of file class.nusoap.php.

XMLSchema::addElement ( attrs  ) 

adds an element to the schema

Parameters:
array $attrs attributes that must include name and type
See also:
xmlschema public

Definition at line 1867 of file class.nusoap.php.


The documentation for this class was generated from the following file:


Généré par Le spécialiste TYPO3 avec  doxygen 1.4.6