XBRL-Package.php
protected function processSchemaDocument( $context, $content, $throwException = true )
	{
		if ( ! isXml( $content, $throwException ) ) return false;

		if ( is_null( $this->schemaNamespace ) )
		{
			$this->schemaNamespace = $this->getTargetNamespace( $this->schemaFile,  $content, $throwException );
			if ( ! $this->schemaNamespace )
			{
				$msg = "Unable to find the taxonomy namespace";
				$this->errors[] = $msg;

				if ( $throwException )
				{
					throw new \Exception( $msg );
				}

				return false;
			}
		}

		$part = parse_url( $this->schemaFile, PHP_URL_SCHEME );
		$prefix = empty( $part ) ? $this->schemaNamespace . "/" : "";
		$schemaFile = "$prefix{$this->schemaFile}";

		if ( $context->findCachedFile( "$schemaFile" ) )
		{
			$msg = "The taxonomy already exists in the cache";
			$this->errors[] = $msg;

			if ( $throwException )
			{
				throw new \Exception( $msg );
			}

			return false;
		}

		if ( ! $context->saveCacheFile( "$schemaFile", $content ) )
		{
			$msg = "Unable to save the schema file ('$schemaFile')";
			$this->errors[] = $msg;

			if ( $throwException )
			{
				throw new \Exception( $msg );
			}

			return false;
		}

		return $this->schemaNamespace;
	}
protected function processSchemaDocument( $context, $content, $throwException = true )
	{
		if ( ! isXml( $content, $throwException ) ) return false;

		if ( is_null( $this->schemaNamespace ) )
		{
			$this->schemaNamespace = $this->getTargetNamespace( $this->schemaFile,  $content, $throwException );
			if ( ! $this->schemaNamespace )
			{
				$msg = "Unable to find the taxonomy namespace";
				$this->errors[] = $msg;

				if ( $throwException )
				{
					throw new \Exception( $msg );
				}

				return false;
			}
		}

		$part = parse_url( $this->schemaFile, PHP_URL_SCHEME );
		$prefix = empty( $part ) ? $this->schemaNamespace . "/" : "";
		$schemaFile = "$prefix{$this->schemaFile}";

		if ( $context->findCachedFile( "$schemaFile" ) )
		{
			$msg = "The taxonomy already exists in the cache";
			$this->errors[] = $msg;

			if ( $throwException )
			{
				throw new \Exception( $msg );
			}

			return false;
		}

		if ( ! $context->saveCacheFile( "$schemaFile", $content ) )
		{
			$msg = "Unable to save the schema file ('$schemaFile')";
			$this->errors[] = $msg;

			if ( $throwException )
			{
				throw new \Exception( $msg );
			}

			return false;
		}

		return $this->schemaNamespace;
	}
protected function processSchemaDocument ( $ context , $ content , $ throwException = true ) { if ( ! isXml ( $ content , $ throwException ) ) return false ; if ( is_null ( $ this -> schemaNamespace ) ) { $ this -> schemaNamespace = $ this -> getTargetNamespace ( $ this -> schemaFile , $ content , $ throwException ) ; if ( ! $ this -> schemaNamespace ) { $ msg = "Unable to find the taxonomy namespace" ; $ this -> errors [ ] = $ msg ; if ( $ throwException ) { throw new \ Exception ( $ msg ) ; } return false ; } } $ part = parse_url ( $ this -> schemaFile , PHP_URL_SCHEME ) ; $ prefix = empty ( $ part ) ? $ this -> schemaNamespace . "/" : "" ; $ schemaFile = "$prefix{$this->schemaFile}" ; if ( $ context -> findCachedFile ( "$schemaFile" ) ) { $ msg = "The taxonomy already exists in the cache" ; $ this -> errors [ ] = $ msg ; if ( $ throwException ) { throw new \ Exception ( $ msg ) ; } return false ; } if ( ! $ context -> saveCacheFile ( "$schemaFile" , $ content ) ) { $ msg = "Unable to save the schema file ('$schemaFile')" ; $ this -> errors [ ] = $ msg ; if ( $ throwException ) { throw new \ Exception ( $ msg ) ; } return false ; } return $ this -> schemaNamespace ; }
Processes the schema document in a consistent way
@param \XBRL_Global $context A reference to the global context
@param bytes $content Expected to be an XML schema
@param bool $throwException True if an exception should be thrown on error or false is returned otherwise
@return bool
@throws \Exception
Processes the schema document in a consistent way