00001 <?php 00002 00008 class HTMLPurifier_ConfigSchema_Interchange 00009 { 00010 00014 public $name; 00015 00019 public $namespaces = array(); 00020 00024 public $directives = array(); 00025 00029 public function addNamespace($namespace) { 00030 if (isset($this->namespaces[$i = $namespace->namespace])) { 00031 throw new HTMLPurifier_ConfigSchema_Exception("Cannot redefine namespace '$i'"); 00032 } 00033 $this->namespaces[$i] = $namespace; 00034 } 00035 00039 public function addDirective($directive) { 00040 if (isset($this->directives[$i = $directive->id->toString()])) { 00041 throw new HTMLPurifier_ConfigSchema_Exception("Cannot redefine directive '$i'"); 00042 } 00043 $this->directives[$i] = $directive; 00044 } 00045 00050 public function validate() { 00051 $validator = new HTMLPurifier_ConfigSchema_Validator(); 00052 return $validator->validate($this); 00053 } 00054 00055 }
1.5.3