SimpleXMLElement->registerXPathNamespace()
(no version information, might be only in CVS)
SimpleXMLElement->registerXPathNamespace() -- Creates a prefix/ns context for the next XPath queryOpis
class SimpleXMLElement {bool registerXPathNamespace ( string prefix, string ns )
}
Creates a prefix/ns context for the next XPath query. In particular, this is helpful if the provider of the given XML document alters the namespace prefixes. registerXPathNamespace will create a prefix for the associated namespace, allowing one to access nodes in that namespace without the need to change code to allow for the new prefixes dictated by the provider.
Parametry
prefix
The namespace prefix to use in the XPath query for the namespace given in
ns
.ns
The namespace to use for the XPath query. This must match a namespace in use by the XML document or the XPath query using
prefix
will not return any results.
Przykłady
Poprzedni | Spis treści | Następny |
SimpleXMLElement->getNamespaces() | Początek rozdziału |