Source for file Namespace.php
Documentation is available at Namespace.php
// +---------------------------------------------------------------------------+
// | PEAR :: XML :: Transformer |
// +---------------------------------------------------------------------------+
// | Copyright (c) 2002-2005 Sebastian Bergmann <sb@sebastian-bergmann.de> and |
// +---------------------------------------------------------------------------+
// | This source file is subject to version 3.00 of the PHP License, |
// | that is available at http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +---------------------------------------------------------------------------+
require_once 'XML/Util.php';
* Convenience Base Class for Namespace Transformers.
* require_once 'XML/Transformer.php';
* require_once 'XML/Transformer/Namespace.php';
* class Image extends XML_Transformer_Namespace {
* var $imageAttributes = array();
* function truePath($path) {
* if (php_sapi_name() == 'apache') {
* $r = apache_lookup_uri($path);
* $path = $_SERVER['DOCUMENT_ROOT'] . "/$path";
* function start_img($attributes) {
* $this->imageAttributes = $attributes;
* function end_img($cdata) {
* $src = $this->truePath($this->imageAttributes['src']);
* list($w, $h, $t, $whs) = getimagesize($src);
* $this->imageAttributes['height'] = $w;
* $this->imageAttributes['width'] = $h;
* XML_Transformer::attributesToString($this->imageAttributes)
* @author Sebastian Bergmann <sb@sebastian-bergmann.de>
* @license http://www.php.net/license/3_0.txt The PHP License, Version 3.0
* @package XML_Transformer
// {{{ function initObserver($prefix, &$object)
* Called by XML_Transformer at initialization time.
* We use this to remember our namespace prefixes
* (there can be multiple) and a pointer to the
$this->_prefix[] = $prefix;
$this->_transformer = $object;
// {{{ function startElement($element, $attributes)
* Wrapper for startElement handler.
$do = 'start_' . $element;
return $this->$do($attributes);
XML_Util ::attributesToString ($attributes)
// {{{ function endElement($element, $cdata)
* Wrapper for endElement handler.
return $this->$do($cdata);
// {{{ function function getLock()
* Lock all other namespace handlers.
return $this->_transformer->_callbackRegistry ->getLock ($this->_prefix[0 ]);
// {{{ function releaseLock()
$this->_transformer->_callbackRegistry ->releaseLock ();
* vim600: et sw=2 ts=2 fdm=marker
Documentation generated on Mon, 11 Mar 2019 15:48:10 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|