Changeset 1926
- Timestamp:
- 05/11/07 13:05:39 (20 months ago)
- Location:
- branches/david-xml_config_handlers/src/config
- Files:
-
- 2 modified
-
AgaviIXmlConfigHandler.interface.php (modified) (1 diff)
-
AgaviXmlConfigParser.class.php (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/david-xml_config_handlers/src/config/AgaviIXmlConfigHandler.interface.php
r1924 r1926 59 59 * @since 0.11.0 60 60 */ 61 public function execute(array $ array= array());61 public function execute(array $docs = array()); 62 62 } 63 63 -
branches/david-xml_config_handlers/src/config/AgaviXmlConfigParser.class.php
r1923 r1926 40 40 41 41 /** 42 * @var string The path to the config file we're currently parsing. 43 */ 44 protected $config = ''; 45 46 /** 42 47 * @param string An absolute filesystem path to a configuration file. 43 48 * @param array An associative array of validation information. … … 133 138 public function load($config) 134 139 { 140 $this->config = $config; 141 135 142 $luie = libxml_use_internal_errors(true); 136 143 libxml_clear_errors(); … … 186 193 ); 187 194 } 195 } 196 197 $xpath = $this->createXpath($doc); 198 // remove all xml:base attributes inserted by XIncludes 199 $nodes = $xpath->query('//@xml:base', $doc); 200 foreach($nodes as $node) { 201 $node->ownerElement->removeAttributeNode($node); 188 202 } 189 203 … … 241 255 sprintf( 242 256 'Configuration file "%s" could not be parsed due to the following error%s that occured while loading the specified XSL stylesheet "%s": ' . "\n\n%s", 243 $ config,257 $this->config, 244 258 count($errors) > 1 ? 's' : '', 245 259 $href, … … 252 266 sprintf( 253 267 'Configuration file "%s" could not be parsed because the inline stylesheet "%s" referenced in the "xml-stylesheet" processing instruction could not be found in the document.', 254 $ config,268 $this->config, 255 269 $href 256 270 ) … … 271 285 sprintf( 272 286 'Configuration file "%s" could not be parsed due to the following error%s that occured while loading the specified XSL stylesheet "%s": ' . "\n\n%s", 273 $ config,287 $this->config, 274 288 count($errors) > 1 ? 's' : '', 275 289 $href, … … 294 308 sprintf( 295 309 'Configuration file "%s" could not be parsed due to the following error%s that occured while importing the specified XSL stylesheet "%s": ' . "\n\n%s", 296 $ config,310 $this->config, 297 311 count($errors) > 1 ? 's' : '', 298 312 $href, … … 316 330 sprintf( 317 331 'Configuration file "%s" could not be parsed due to the following error%s that occured while transforming the document using the XSL stylesheet "%s": ' . "\n\n%s", 318 $ config,332 $this->config, 319 333 count($errors) > 1 ? 's' : '', 320 334 $href, … … 402 416 if(!is_readable($validationFile)) { 403 417 libxml_use_internal_errors($luie); 404 $error = 'Validation file "' . $validationFile . '" for configuration file "' . $ config . '" does not exist or is unreadable';418 $error = 'Validation file "' . $validationFile . '" for configuration file "' . $this->config . '" does not exist or is unreadable'; 405 419 throw new AgaviUnreadableException($error); 406 420 } … … 416 430 sprintf( 417 431 'XML Schema validation of configuration file "%s" failed due to the following error%s: ' . "\n\n%s", 418 $ config,432 $this->config, 419 433 count($errors) > 1 ? 's' : '', 420 434 implode("\n", $errors) … … 443 457 if(!is_readable($validationFile)) { 444 458 libxml_use_internal_errors($luie); 445 $error = 'Validation file "' . $validationFile . '" for configuration file "' . $ config . '" does not exist or is unreadable';459 $error = 'Validation file "' . $validationFile . '" for configuration file "' . $this->config . '" does not exist or is unreadable'; 446 460 throw new AgaviUnreadableException($error); 447 461 } … … 457 471 sprintf( 458 472 'XML Schema validation of configuration file "%s" failed due to the following error%s: ' . "\n\n%s", 459 $ config,473 $this->config, 460 474 count($errors) > 1 ? 's' : '', 461 475 implode("\n", $errors) … … 487 501 if(!is_readable($validationFile)) { 488 502 libxml_use_internal_errors($luie); 489 $error = 'Validation file "' . $validationFile . '" for configuration file "' . $ config . '" does not exist or is unreadable';503 $error = 'Validation file "' . $validationFile . '" for configuration file "' . $this->config . '" does not exist or is unreadable'; 490 504 throw new AgaviUnreadableException($error); 491 505 } … … 501 515 sprintf( 502 516 'XML Schema validation of configuration file "%s" failed due to the following error%s: ' . "\n\n%s", 503 $ config,517 $this->config, 504 518 count($errors) > 1 ? 's' : '', 505 519 implode("\n", $errors)

