Formulas/Resources/Assertions/ExistenceAssertion.php
public function validate( $variableSet, $nsMgr )
	{
		if ( ! $this->test ) return true;

		try
		{
			$expression = XPath2Expression::Compile( $this->test, $nsMgr );
			$this->testXPath2Expression = $expression;

			$variableRefs = $this->getVariableRefs();
			foreach ( $variableRefs as $qname => $variableRef )
			{
				// Look for general or fact variables with this qname
				if ( isset( $this->variablesByQName[ (string)$variableRef ] ) )
				{
					\XBRL_Log::getInstance()->existenceassertion_validation(
						"Existent assertion",
						"An existance assertion test cannot reference fact or general variables",
						array(
							'label' => $this->label,
							'error' => 'xbrleae:variableReferenceNotAllowed'
						)
					);
				}
			}

			return true;
		}
		catch ( Exception $ex )
		{
			\XBRL_Log::getInstance()->valueassertion_validation( "Value assertion", "Failed to compile test expression",
				array(
					'test expression' => $this->test,
					'error' => $ex instanceof XPath2Exception ? $ex->ErrorCode : get_class( $ex ),
					'reason' => $ex->getMessage()
				)
			);

			return false;
		}

	}
public function validate( $variableSet, $nsMgr )
	{
		if ( ! $this->test ) return true;

		try
		{
			$expression = XPath2Expression::Compile( $this->test, $nsMgr );
			$this->testXPath2Expression = $expression;

			$variableRefs = $this->getVariableRefs();
			foreach ( $variableRefs as $qname => $variableRef )
			{
				// Look for general or fact variables with this qname
				if ( isset( $this->variablesByQName[ (string)$variableRef ] ) )
				{
					\XBRL_Log::getInstance()->existenceassertion_validation(
						"Existent assertion",
						"An existance assertion test cannot reference fact or general variables",
						array(
							'label' => $this->label,
							'error' => 'xbrleae:variableReferenceNotAllowed'
						)
					);
				}
			}

			return true;
		}
		catch ( Exception $ex )
		{
			\XBRL_Log::getInstance()->valueassertion_validation( "Value assertion", "Failed to compile test expression",
				array(
					'test expression' => $this->test,
					'error' => $ex instanceof XPath2Exception ? $ex->ErrorCode : get_class( $ex ),
					'reason' => $ex->getMessage()
				)
			);

			return false;
		}

	}
public function validate ( $ variableSet , $ nsMgr ) { if ( ! $ this -> test ) return true ; try { $ expression = XPath2Expression :: Compile ( $ this -> test , $ nsMgr ) ; $ this -> testXPath2Expression = $ expression ; $ variableRefs = $ this -> getVariableRefs ( ) ; foreach ( $ variableRefs as $ qname => $ variableRef ) { // Look for general or fact variables with this qname
 if ( isset ( $ this -> variablesByQName [ ( string ) $ variableRef ] ) ) { \ XBRL_Log :: getInstance ( ) -> existenceassertion_validation ( "Existent assertion" , "An existance assertion test cannot reference fact or general variables" , array ( 'label' => $ this -> label , 'error' => 'xbrleae:variableReferenceNotAllowed' ) ) ; } } return true ; } catch ( Exception $ ex ) { \ XBRL_Log :: getInstance ( ) -> valueassertion_validation ( "Value assertion" , "Failed to compile test expression" , array ( 'test expression' => $ this -> test , 'error' => $ ex instanceof XPath2Exception ? $ ex -> ErrorCode : get_class ( $ ex ) , 'reason' => $ ex -> getMessage ( ) ) ) ; return false ; } }
If a test property exists it MUST NOT have dependencies on fact or general variables
@param VariableSet $variableSet
@param XmlNamespaceManager $nsMgr
If a test property exists it MUST NOT have dependencies on fact or general variables