phpDocumentor default
[ class tree: default ] [ index: default ] [ all elements ]

Class: XMLSchema

Source Location: /lodel/scripts/nusoap.php

Class XMLSchema

Class Overview

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 :)

Located in /lodel/scripts/nusoap.php [line 809]

nusoap_base
   |
   --XMLSchema
Author(s): API Tags:
Access:  public

Information Tags:
Version:  $Id: nusoap.php 3705 2006-09-14 16:06:29Z cenou $

Properties

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From nusoap_base

nusoap_base::$charencoding
nusoap_base::$debug_str
nusoap_base::$error_str
nusoap_base::$namespaces
nusoap_base::$revision
nusoap_base::$soap_defencoding
nusoap_base::$title
nusoap_base::$typemap
nusoap_base::$usedNamespaces
nusoap_base::$version
nusoap_base::$xmlEntities
nusoap_base::$XMLSchemaVersion

Inherited From nusoap_base

nusoap_base::appendDebug()
adds debug data to the instance debug string without formatting
nusoap_base::clearDebug()
clears the current debug data for this instance
nusoap_base::contractQname()
contracts a qualified name
nusoap_base::debug()
adds debug data to the instance debug string with formatting
nusoap_base::expandEntities()
expands entities, e.g. changes '<' to '&lt;'.
nusoap_base::expandQname()
expands a qualified name
nusoap_base::formatDump()
nusoap_base::getDebug()
gets the current debug data for this instance
nusoap_base::getDebugAsXMLComment()
gets the current debug data for this instance as an XML comment this may change the contents of the debug data
nusoap_base::getError()
returns error string if present
nusoap_base::getLocalPart()
returns the local part of a prefixed string returns the original string, if not prefixed
nusoap_base::getmicrotime()
returns the time in ODBC canonical form with microseconds
nusoap_base::getNamespaceFromPrefix()
pass it a prefix, it returns a namespace returns false if no namespace registered with the given prefix
nusoap_base::getPrefix()
returns the prefix part of a prefixed string returns false, if not prefixed
nusoap_base::getPrefixFromNamespace()
returns the prefix for a given namespace (or prefix) or false if no prefixes registered for the given namespace
nusoap_base::isArraySimpleOrStruct()
detect if array is a simple array or a struct (associative array)
nusoap_base::serializeEnvelope()
serialize message
nusoap_base::serialize_val()
serializes PHP values in accordance w/ section 5. Type information is not serialized if $use == 'literal'.
nusoap_base::setError()
sets error string
nusoap_base::varDump()

[ Top ]
Property Summary
mixed   $attributes  
mixed   $complexTypes  
mixed   $currentComplexType  
mixed   $currentElement  
mixed   $currentSimpleType  
mixed   $defaultNamespace  
mixed   $depth  
mixed   $depth_array  
mixed   $elements  
mixed   $enclosingNamespaces  
mixed   $imports  
mixed   $message  
mixed   $parser  
mixed   $position  
mixed   $schema  
mixed   $schemaInfo  
mixed   $schemaTargetNamespace  
mixed   $simpleTypes  
mixed   $xml  

[ Top ]
Method Summary
XMLSchema   XMLSchema()   constructor
void   addComplexType()   adds a complex type to the schema
void   addSimpleType()   adds a simple type to the schema
mixed   getPHPType()   get the PHP type of a user defined type in the schema
mixed   getTypeDef()   returns an array of information about a given type returns false if no type exists by the given name
boolean   parseFile()   parse an XML file
void   parseString()   parse an XML string
void   schemaCharacterData()   element content handler
void   schemaEndElement()   end-element handler
void   schemaStartElement()   start-element handler
void   serializeSchema()   serialize the schema
mixed   serializeTypeDef()   returns a sample serialization of a given type, or false if no type by the given name
string   typeToForm()   returns HTML form elements that allow a user to enter values for creating an instance of the given type.
void   xdebug()   adds debug data to the clas level debug string

[ Top ]
Properties
mixed   $attributes = array() [line 820]

[ Top ]
mixed   $complexTypes = array() [line 821]

[ Top ]
mixed   $currentComplexType = false [line 822]

[ Top ]
mixed   $currentElement = false [line 824]

[ Top ]
mixed   $currentSimpleType = false [line 826]

[ Top ]
mixed   $defaultNamespace = array() [line 835]

[ Top ]
mixed   $depth = 0 [line 832]

[ Top ]
mixed   $depth_array = array() [line 833]

[ Top ]
mixed   $elements = array() [line 823]

[ Top ]
mixed   $enclosingNamespaces [line 815]

[ Top ]
mixed   $imports = array() [line 828]

[ Top ]
mixed   $message = array() [line 834]

[ Top ]
mixed   $parser [line 830]

[ Top ]
mixed   $position = 0 [line 831]

[ Top ]
mixed   $schema = '' [line 812]

[ Top ]
mixed   $schemaInfo = array() [line 817]

[ Top ]
mixed   $schemaTargetNamespace = '' [line 818]

[ Top ]
mixed   $simpleTypes = array() [line 825]

[ Top ]
mixed   $xml = '' [line 813]

[ Top ]
Methods
Constructor XMLSchema  [line 845]

  XMLSchema XMLSchema( [string $schema = ''], [string $xml = ''], [string $namespaces = array()]  )

constructor

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

API Tags:
Access:  public


[ Top ]
addComplexType  [line 1526]

  void addComplexType( name $name, [typeClass $typeClass = 'complexType'], [phpType: $phpType = 'array'], [compositor $compositor = ''], [restrictionBase $restrictionBase = ''], [elements $elements = array()], [attrs $attrs = array()], [arrayType: $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   $name: 
typeClass   $typeClass:  (complexType|simpleType|attribute)
phpType:   $phpType:  currently supported are array and struct (php assoc array)
compositor   $compositor:  (all|sequence|choice)
restrictionBase   $restrictionBase:  namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)
elements   $elements:  = array ( name = array(name=>'',type=>'') )
attrs   $attrs:  = array( array( 'ref' => "http://schemas.xmlsoap.org/soap/encoding/:arrayType", "http://schemas.xmlsoap.org/wsdl/:arrayType" => "string[]" ) )
arrayType:   $arrayType:  namespace:name (http://www.w3.org/2001/XMLSchema:string)


[ Top ]
addSimpleType  [line 1552]

  void addSimpleType( name $name, [restrictionBase $restrictionBase = ''], [typeClass $typeClass = 'simpleType'], [phpType: $phpType = 'scalar']  )

adds a simple type to the schema

Parameters:
name   $name: 
restrictionBase   $restrictionBase:  namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)
typeClass   $typeClass:  (simpleType)
phpType:   $phpType:  (scalar)

API Tags:
See:  xmlschema


[ Top ]
getPHPType  [line 1336]

  mixed getPHPType( $type, $ns, string $type,, string $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
   $type: 
   $ns: 

API Tags:
Access:  public


[ Top ]
getTypeDef  [line 1363]

  mixed getTypeDef( string $type  )

returns an array of information about a given type returns false if no type exists by the given name

typeDef = array( 'elements' => array(), // refs to elements array 'restrictionBase' => '', 'phpType' => '', 'order' => '(sequence|all)', 'attrs' => array() // refs to attributes array )

Parameters:
string   $type: 

API Tags:
Access:  public


[ Top ]
parseFile  [line 878]

  boolean parseFile( $xml, $type, string $xml,, string $type,  )

parse an XML file

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

API Tags:
Access:  public


[ Top ]
parseString  [line 904]

  void parseString( string $xml, $type, string $type,  )

parse an XML string

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

API Tags:
Access:  private


[ Top ]
schemaCharacterData  [line 1218]

  void schemaCharacterData( string $parser, string $data  )

element content handler

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

API Tags:
Access:  private


[ Top ]
schemaEndElement  [line 1191]

  void schemaEndElement( string $parser, string $name  )

end-element handler

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

API Tags:
Access:  private


[ Top ]
schemaStartElement  [line 952]

  void schemaStartElement( string $parser, string $name, string $attrs  )

start-element handler

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

API Tags:
Access:  private


[ Top ]
serializeSchema  [line 1228]

  void serializeSchema( )

serialize the schema


API Tags:
Access:  public


[ Top ]
serializeTypeDef  [line 1420]

  mixed serializeTypeDef( $type, string $type,  )

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

Parameters:
string   $type,:  name of type
   $type: 

API Tags:
Access:  public


[ Top ]
typeToForm  [line 1455]

  string typeToForm( $name, $type, string $name,, string $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
   $name: 
   $type: 

API Tags:
Access:  public


[ Top ]
xdebug  [line 1321]

  void xdebug( string $string  )

adds debug data to the clas level debug string

Parameters:
string   $string:  debug data

API Tags:
Access:  private


[ Top ]

Documentation generated on Wed, 19 Sep 2007 05:07:19 +0200 by phpDocumentor 1.4.0a2