/**
  * @param SchemaProperty $schemaprop
  * @param Schema         $schemaObj
  */
 public function setDefaultUri($schemaprop, $schemaObj)
 {
     $newURI = $schemaObj->getNamespace();
     $UriId = $schemaObj->getLastUriId() + 1;
     $schemaprop->setUri($newURI . $UriId);
     $this->setDefaultLexicalAlias($schemaprop, $newURI);
 }
Beispiel #2
0
 /**
  * @param string $basePath
  * @param string $schemaLocation
  * @return Schema
  */
 public function import($basePath, $schemaLocation)
 {
     $p = parse_url($schemaLocation);
     if (empty($p['scheme'])) {
         $schemaLocation = realpath($basePath . '/' . $p['path']);
         if (!empty($this->realPathToImport[$schemaLocation])) {
             return $this->imports[$this->realPathToImport[$schemaLocation]];
         }
         $dom = new Schema($schemaLocation);
         $basePath = dirname($schemaLocation);
         foreach ($dom->getImports() as $import) {
             $this->import($basePath, $import->value);
         }
         foreach ($dom->getLinkbases() as $import) {
             $this->importLinkbase($basePath, $import->value);
         }
         $namespace = $dom->getNamespace();
         $this->imports[$namespace] = $dom;
         $this->realPathToImport[$schemaLocation] = $namespace;
         return $dom;
     }
     return null;
 }
Beispiel #3
0
 /**
  * @return string
  */
 public function getNamespace()
 {
     return $this->parent->getNamespace();
 }