Ampache
[ class tree: Ampache ] [ index: Ampache ] [ all elements ]

Class: nusoap_xmlschema

Source Location: /modules/nusoap/class.xmlschema.php

Class Overview

nusoap_base
   |
   --nusoap_xmlschema

parses an XML Schema, allows access to it's data, other utility methods.


Author(s):

Version:

  • $Id$

Variables

Methods


Child classes:

XMLSchema
Backward compatibility

Class Details

[line 15]
parses an XML Schema, allows access to it's data, other utility methods.

imperfect, no validation... yet, but quite functional.




Tags:

author:  Scott Nichol <snichol@users.sourceforge.net>
author:  Dietrich Ayala <dietrich@ganx4.com>
version:  $Id$
access:  public


[ Top ]


Class Variables

$attributes = array()

[line 26]


Type:   mixed


[ Top ]

$complexTypes = array()

[line 27]


Type:   mixed


[ Top ]

$complexTypeStack = array()

[line 28]


Type:   mixed


[ Top ]

$currentComplexType =  null

[line 29]


Type:   mixed


[ Top ]

$currentElement =  null

[line 32]


Type:   mixed


[ Top ]

$currentSimpleType =  null

[line 35]


Type:   mixed


[ Top ]

$defaultNamespace = array()

[line 44]


Type:   mixed


[ Top ]

$depth =  0

[line 41]


Type:   mixed


[ Top ]

$depth_array = array()

[line 42]


Type:   mixed


[ Top ]

$elements = array()

[line 30]


Type:   mixed


[ Top ]

$elementStack = array()

[line 31]


Type:   mixed


[ Top ]

$enclosingNamespaces =

[line 21]


Type:   mixed


[ Top ]

$imports = array()

[line 37]


Type:   mixed


[ Top ]

$message = array()

[line 43]


Type:   mixed


[ Top ]

$parser =

[line 39]


Type:   mixed


[ Top ]

$position =  0

[line 40]


Type:   mixed


[ Top ]

$schema =  ''

[line 18]


Type:   mixed


[ Top ]

$schemaInfo = array()

[line 23]


Type:   mixed


[ Top ]

$schemaTargetNamespace =  ''

[line 24]


Type:   mixed


[ Top ]

$simpleTypes = array()

[line 33]


Type:   mixed


[ Top ]

$simpleTypeStack = array()

[line 34]


Type:   mixed


[ Top ]

$xml =  ''

[line 19]


Type:   mixed


[ Top ]



Class Methods


constructor nusoap_xmlschema [line 54]

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

constructor



Tags:

access:  public


Parameters:

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

[ Top ]

method addComplexType [line 871]

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




Tags:

see:  nusoap_xmlschema::getTypeDef()
access:  public


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 ]

method addElement [line 919]

void addElement( array $attrs)

adds an element to the schema



Tags:

see:  nusoap_xmlschema
access:  public


Parameters:

array   $attrs   attributes that must include name and type

[ Top ]

method addSimpleType [line 899]

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

adds a simple type to the schema



Tags:

see:  nusoap_xmlschema::getTypeDef()
see:  nusoap_xmlschema
access:  public


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

[ Top ]

method getPHPType [line 654]

mixed getPHPType( 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'




Tags:

deprecated:  
access:  public


Parameters:

string   $type   name of defined type
string   $ns   namespace of type

[ Top ]

method getTypeDef [line 687]

mixed getTypeDef( string $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.




Tags:



Parameters:

string   $type  

[ Top ]

method parseFile [line 87]

boolean parseFile( string $xml, string $type)

parse an XML file



Tags:

access:  public


Parameters:

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

[ Top ]

method serializeSchema [line 520]

void serializeSchema( )

serialize the schema



Tags:

access:  public


[ Top ]

method serializeTypeDef [line 763]

mixed serializeTypeDef( string $type)

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



Tags:

deprecated:  
access:  public


Parameters:

string   $type   name of type

[ Top ]

method typeToForm [line 799]

string typeToForm( string $name, string $type)

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



Tags:

deprecated:  
access:  public


Parameters:

string   $name   name for type instance
string   $type   name of type

[ Top ]


Documentation generated on Thu, 12 Feb 2009 07:59:55 +0900 by phpDocumentor 1.4.2