isValid() public static method

Note that this function returns values that are evaluated as a logical true, both when validation works and when it doesn't. Please use strict comparisons to check the values returned.
Author: Olav Morken, UNINETT AS (olav.morken@uninett.no)
public static isValid ( string | DOMDocument $xml, string $schema ) : boolean | string
$xml string | DOMDocument The XML string or document which should be validated.
$schema string The filename of the schema that should be used to validate the document.
return boolean | string Returns a string with errors found if validation fails. True if validation passes ok.
Esempio n. 1
0
 /**
  * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\XML::isValid() instead.
  */
 public static function validateXML($xml, $schema)
 {
     $result = \SimpleSAML\Utils\XML::isValid($xml, $schema);
     return $result === true ? '' : $result;
 }