public function validateNg($ng) { try { $this->dom->relaxNGValidateSource($ng); $this->throwError(); } catch (\DOMException $e) { throw new \RuntimeException($e->getMessage()); } }