registerNamespace() public static method

Takes a prefix and a full namespace URI and adds them to the list of registered namespaces for use by Horde_Xml_Element::lookupNamespace().
public static registerNamespace ( string $prefix, string $namespaceURI )
$prefix string The namespace prefix
$namespaceURI string The full namespace URI
Example #1
0
 /**
  * Constructor.
  *
  * @param resource|string $xml The XML document received from the server.
  */
 public function __construct($xml)
 {
     if (is_resource($xml)) {
         rewind($xml);
         $xml = stream_get_contents($xml);
     }
     parent::registerNamespace('xlink', 'http://www.w3.org/1999/xlink');
     parent::__construct($xml);
 }
Example #2
0
 public function __construct($uri = 'http://www.example.com/myfeed/', $xml = null)
 {
     parent::__construct($uri, $xml);
     Horde_Xml_Element::registerNamespace('myns', 'http://www.example.com/myns/');
 }