SimpleXMLElement::xpath
En esta página
SimpleXMLElement::xpath
Ejecuta una consulta XPath sobre datos XML
Descripción#
public SimpleXMLElement::xpath(string $expression): array
```php
El método `xpath` busca en el nodo SimpleXML hijos que correspondan al `expression` Xpath.
## Parámetros
`expression`
Una ruta XPath
## Valores devueltos
Devuelve un array de objetos SimpleXMLElement en caso de éxito o `null` o `false` si ocurre un error.
## Ejemplos
Xpath
```php
El ejemplo anterior mostrará:
/a/b/c: text
/a/b/c: stuff
b/c: text
b/c: stuff
Observe que los dos resultados son iguales.
Véase también#
SimpleXMLElement::registerXPathNamespace, SimpleXMLElement::getDocNamespaces, SimpleXMLElement::getNamespaces, ???