Lines Matching refs:this

56 		$this->debug('nusoap_xmlschema class instantiated, inside constructor');
58 $this->schema = $schema;
59 $this->xml = $xml;
62 $this->enclosingNamespaces = $namespaces;
63 $this->namespaces = array_merge($this->namespaces, $namespaces);
67 $this->debug('initial schema file: '.$schema);
68 $this->parseFile($schema, 'schema');
73 $this->debug('initial xml file: '.$xml);
74 $this->parseFile($xml, 'xml');
93 $this->setError($msg);
94 $this->debug($msg);
97 $this->debug("parsing $xml");
98 $this->parseString($xmlStr,$type);
99 $this->debug("done parsing $xml");
118 $this->parser = xml_parser_create();
120 xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
123 xml_set_object($this->parser, $this);
127 xml_set_element_handler($this->parser, 'schemaStartElement','schemaEndElement');
128 xml_set_character_data_handler($this->parser,'schemaCharacterData');
130 xml_set_element_handler($this->parser, 'xmlStartElement','xmlEndElement');
131 xml_set_character_data_handler($this->parser,'xmlCharacterData');
135 if(!xml_parse($this->parser,$xml,true)){
138 xml_get_current_line_number($this->parser),
139 xml_error_string(xml_get_error_code($this->parser))
141 $this->debug($errstr);
142 $this->debug("XML payload:\n" . $xml);
143 $this->setError($errstr);
146 xml_parser_free($this->parser);
148 $this->debug('no xml passed to parseString()!!');
149 $this->setError('no xml passed to parseString()!!');
162 for ($i = 0; $i < count($this->complexTypeStack); $i++) {
163 $scope .= $this->complexTypeStack[$i] . '_';
179 $pos = $this->position++;
180 $depth = $this->depth++;
182 $this->depth_array[$depth] = $pos;
183 $this->message[$pos] = array('cdata' => '');
185 $this->defaultNamespace[$pos] = $this->defaultNamespace[$this->depth_array[$depth - 1]];
187 $this->defaultNamespace[$pos] = false;
191 if($prefix = $this->getPrefix($name)){
193 $name = $this->getLocalPart($name);
207 $this->namespaces[$ns_prefix] = $v;
209 $this->defaultNamespace[$pos] = $v;
210 if (! $this->getPrefixFromNamespace($v)) {
211 $this->namespaces['ns'.(count($this->namespaces)+1)] = $v;
215 $this->XMLSchemaVersion = $v;
216 $this->namespaces['xsi'] = $v.'-instance';
222 $k = strpos($k,':') ? $this->expandQname($k) : $k;
223 $v = strpos($v,':') ? $this->expandQname($v) : $v;
237 $this->complexTypes[$this->currentComplexType]['compositor'] = $name;
244 $this->xdebug("parsing attribute:");
245 $this->appendDebug($this->varDump($attrs));
247 $attrs['form'] = $this->schemaInfo['attributeFormDefault'];
253 if ($this->defaultNamespace[$pos]) {
260 $this->attributes[$attrs['name']] = $attrs;
278 $this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
279 $prefix = $this->getPrefix($aname);
286 $this->complexTypes[$this->currentComplexType]['multidimensional'] = true;
289 if(!strpos($v,':') && isset($this->typemap[$this->XMLSchemaVersion][$v])){
290 $v = $this->XMLSchemaVersion.':'.$v;
292 $this->complexTypes[$this->currentComplexType]['arrayType'] = $v;
298 array_push($this->complexTypeStack, $this->currentComplexType);
302 $this->xdebug('processing named complexType '.$attrs['name']);
304 $this->currentComplexType = $attrs['name'];
305 $this->complexTypes[$this->currentComplexType] = $attrs;
306 $this->complexTypes[$this->currentComplexType]['typeClass'] = 'complexType';
315 $this->xdebug('complexType is unusual array');
316 $this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
318 $this->complexTypes[$this->currentComplexType]['phpType'] = 'struct';
321 $name = $this->CreateTypeName($this->currentElement);
322 …$this->xdebug('processing unnamed complexType for element ' . $this->currentElement . ' named ' . …
323 $this->currentComplexType = $name;
325 $this->complexTypes[$this->currentComplexType] = $attrs;
326 $this->complexTypes[$this->currentComplexType]['typeClass'] = 'complexType';
335 $this->xdebug('complexType is unusual array');
336 $this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
338 $this->complexTypes[$this->currentComplexType]['phpType'] = 'struct';
343 array_push($this->elementStack, $this->currentElement);
345 $attrs['form'] = $this->schemaInfo['elementFormDefault'];
348 $this->xdebug("processing typed element ".$attrs['name']." of type ".$attrs['type']);
349 if (! $this->getPrefix($attrs['type'])) {
350 if ($this->defaultNamespace[$pos]) {
351 $attrs['type'] = $this->defaultNamespace[$pos] . ':' . $attrs['type'];
352 $this->xdebug('used default namespace to make type ' . $attrs['type']);
362 …if ($this->currentComplexType && $this->complexTypes[$this->currentComplexType]['phpType'] == 'arr…
363 $this->xdebug('arrayType for unusual array is ' . $attrs['type']);
364 $this->complexTypes[$this->currentComplexType]['arrayType'] = $attrs['type'];
366 $this->currentElement = $attrs['name'];
369 $this->xdebug("processing element as ref to ".$attrs['ref']);
370 $this->currentElement = "ref to ".$attrs['ref'];
371 $ename = $this->getLocalPart($attrs['ref']);
373 $type = $this->CreateTypeName($this->currentComplexType . '_' . $attrs['name']);
374 $this->xdebug("processing untyped element " . $attrs['name'] . ' type ' . $type);
375 $this->currentElement = $attrs['name'];
376 $attrs['type'] = $this->schemaTargetNamespace . ':' . $type;
379 if (isset($ename) && $this->currentComplexType) {
380 $this->xdebug("add element $ename to complexType $this->currentComplexType");
381 $this->complexTypes[$this->currentComplexType]['elements'][$ename] = $attrs;
383 $this->xdebug("add element $ename to elements array");
384 $this->elements[ $attrs['name'] ] = $attrs;
385 $this->elements[ $attrs['name'] ]['typeClass'] = 'element';
389 $this->xdebug('enumeration ' . $attrs['value']);
390 if ($this->currentSimpleType) {
391 $this->simpleTypes[$this->currentSimpleType]['enumeration'][] = $attrs['value'];
392 } elseif ($this->currentComplexType) {
393 $this->complexTypes[$this->currentComplexType]['enumeration'][] = $attrs['value'];
397 $this->xdebug('extension ' . $attrs['base']);
398 if ($this->currentComplexType) {
399 $this->complexTypes[$this->currentComplexType]['extensionBase'] = $attrs['base'];
405 …$this->imports[$attrs['namespace']][] = array('location' => $attrs['schemaLocation'], 'loaded' => …
408 … $this->imports[$attrs['namespace']][] = array('location' => '', 'loaded' => true);
409 if (! $this->getPrefixFromNamespace($attrs['namespace'])) {
410 $this->namespaces['ns'.(count($this->namespaces)+1)] = $attrs['namespace'];
417 $this->xdebug('restriction ' . $attrs['base']);
418 if($this->currentSimpleType){
419 $this->simpleTypes[$this->currentSimpleType]['type'] = $attrs['base'];
420 } elseif($this->currentComplexType){
421 $this->complexTypes[$this->currentComplexType]['restrictionBase'] = $attrs['base'];
423 $this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
428 $this->schemaInfo = $attrs;
429 $this->schemaInfo['schemaVersion'] = $this->getNamespaceFromPrefix($prefix);
431 $this->schemaTargetNamespace = $attrs['targetNamespace'];
434 $this->schemaInfo['elementFormDefault'] = 'unqualified';
437 $this->schemaInfo['attributeFormDefault'] = 'unqualified';
443 array_push($this->simpleTypeStack, $this->currentSimpleType);
445 $this->xdebug("processing simpleType for name " . $attrs['name']);
446 $this->currentSimpleType = $attrs['name'];
447 $this->simpleTypes[ $attrs['name'] ] = $attrs;
448 $this->simpleTypes[ $attrs['name'] ]['typeClass'] = 'simpleType';
449 $this->simpleTypes[ $attrs['name'] ]['phpType'] = 'scalar';
451 $name = $this->CreateTypeName($this->currentComplexType . '_' . $this->currentElement);
452 …$this->xdebug('processing unnamed simpleType for element ' . $this->currentElement . ' named ' . $…
453 $this->currentSimpleType = $name;
455 $this->simpleTypes[$this->currentSimpleType] = $attrs;
456 $this->simpleTypes[$this->currentSimpleType]['phpType'] = 'scalar';
475 $this->depth--;
477 if(isset($this->depth_array[$this->depth])){
478 $pos = $this->depth_array[$this->depth];
481 if ($prefix = $this->getPrefix($name)){
483 $name = $this->getLocalPart($name);
489 …$this->xdebug('done processing complexType ' . ($this->currentComplexType ? $this->currentComplexT…
490 $this->currentComplexType = array_pop($this->complexTypeStack);
494 …$this->xdebug('done processing element ' . ($this->currentElement ? $this->currentElement : '(unkn…
495 $this->currentElement = array_pop($this->elementStack);
498 …$this->xdebug('done processing simpleType ' . ($this->currentSimpleType ? $this->currentSimpleType…
499 $this->currentSimpleType = array_pop($this->simpleTypeStack);
511 $pos = $this->depth_array[$this->depth - 1];
512 $this->message[$pos]['cdata'] .= $data;
522 $schemaPrefix = $this->getPrefixFromNamespace($this->XMLSchemaVersion);
525 if (sizeof($this->imports) > 0) {
526 foreach($this->imports as $ns => $list) {
537 foreach($this->complexTypes as $typeName => $attrs){
545 …$contentStr .= " <$schemaPrefix:element name=\"$element\" type=\"" . $this->contractQName($ePart…
566 $contentStr .= " $a=\"".$this->contractQName($v).'"';
569 $contentStr .= ' wsdl:arrayType="'.$this->contractQName($v).'"';
619 foreach ($this->schemaInfo as $k => $v) {
624 $el = "<$schemaPrefix:schema$attr targetNamespace=\"$this->schemaTargetNamespace\"\n";
625 foreach (array_diff($this->usedNamespaces, $this->enclosingNamespaces) as $nsp => $ns) {
639 $this->debug('<' . $this->schemaTargetNamespace . '> '.$string);
655 if(isset($this->typemap[$ns][$type])){
657 return $this->typemap[$ns][$type];
658 } elseif(isset($this->complexTypes[$type])){
660 return $this->complexTypes[$type]['phpType'];
696 if((! $is_element) && isset($this->complexTypes[$type])){
697 $this->xdebug("in getTypeDef, found complexType $type");
698 return $this->complexTypes[$type];
699 } elseif((! $is_element) && isset($this->simpleTypes[$type])){
700 $this->xdebug("in getTypeDef, found simpleType $type");
701 if (!isset($this->simpleTypes[$type]['phpType'])) {
704 …$uqType = substr($this->simpleTypes[$type]['type'], strrpos($this->simpleTypes[$type]['type'], ':'…
705 …$ns = substr($this->simpleTypes[$type]['type'], 0, strrpos($this->simpleTypes[$type]['type'], ':')…
706 $etype = $this->getTypeDef($uqType);
708 $this->xdebug("in getTypeDef, found type for simpleType $type:");
709 $this->xdebug($this->varDump($etype));
711 $this->simpleTypes[$type]['phpType'] = $etype['phpType'];
714 $this->simpleTypes[$type]['elements'] = $etype['elements'];
718 return $this->simpleTypes[$type];
719 } elseif(isset($this->elements[$type])){
720 $this->xdebug("in getTypeDef, found element $type");
721 if (!isset($this->elements[$type]['phpType'])) {
723 …$uqType = substr($this->elements[$type]['type'], strrpos($this->elements[$type]['type'], ':') + 1);
724 $ns = substr($this->elements[$type]['type'], 0, strrpos($this->elements[$type]['type'], ':'));
725 $etype = $this->getTypeDef($uqType);
727 $this->xdebug("in getTypeDef, found type for element $type:");
728 $this->xdebug($this->varDump($etype));
730 $this->elements[$type]['phpType'] = $etype['phpType'];
733 $this->elements[$type]['elements'] = $etype['elements'];
751 $this->xdebug("in getTypeDef, did not find $type");
765 if($typeDef = $this->getTypeDef($type)){
772 $str .= " xmlns=\"".$this->schema['targetNamespace']."\"";
776 $str .= $this->serializeTypeDef($element);
801 if($typeDef = $this->getTypeDef($type)){
807 <tr><td align='right'>$childDef[name] (type: ".$this->getLocalPart($childDef['type'])."):</td>
872 $this->complexTypes[$name] = array(
883 $this->xdebug("addComplexType $name:");
884 $this->appendDebug($this->varDump($this->complexTypes[$name]));
900 $this->simpleTypes[$name] = array(
908 $this->xdebug("addSimpleType $name:");
909 $this->appendDebug($this->varDump($this->simpleTypes[$name]));
920 if (! $this->getPrefix($attrs['type'])) {
921 $attrs['type'] = $this->schemaTargetNamespace . ':' . $attrs['type'];
923 $this->elements[ $attrs['name'] ] = $attrs;
924 $this->elements[ $attrs['name'] ]['typeClass'] = 'element';
926 $this->xdebug("addElement " . $attrs['name']);
927 $this->appendDebug($this->varDump($this->elements[ $attrs['name'] ]));