Ejemplo n.º 1
4
    public function testRegisterXpathNamespaces()
    {
        $string = <<<XML
<a xmlns:t2="http://example.com/t">
 <b>
  <t2:c>text</t2:c>
 </b>
</a>
XML;
        $xml = new SimpleXMLElement($string);
        $name = new Services_Yadis_Xrds_Namespace();
        $name->addNamespace('t', 'http://example.com/t');
        $name->registerXpathNamespaces($xml);
        $c = $xml->xpath('//t:c');
        $this->assertEquals('text', (string) $c[0]);
    }
Ejemplo n.º 2
1
 /**
  * Add a single namespace to be utilised by the XML parser when it receives
  * a valid XRD document.
  *
  * @param   string $namespace
  * @param   string $namespaceUrl
  * @return  Services_Yadis
  */
 public function addNamespace($namespace, $namespaceUrl)
 {
     $this->_namespace->addNamespace($namespace, $namespaceUrl);
     return $this;
 }