Easy Tutorial
❮ Func Filesystem Filegroup Func Filesystem Flock ❯

PHP registerXPathNamespace() Function

PHP SimpleXML Reference Manual

Example

Create a namespace context for the next XPath query:


Definition and Usage

The registerXPathNamespace() function creates a namespace context for the next XPath query.

This function is useful if the namespace prefix is changed in the XML document. The registerXPathNamespace() function will create a specified namespace prefix, allowing affected XML nodes to be accessed without significantly altering the application code.


Syntax

Parameter Description
prefix Required. Specifies the namespace prefix to be used in XPath queries for the namespace specified in ns.
ns Required. Specifies the namespace to be used in XPath queries.

Technical Details

Return Value: Returns TRUE on success, FALSE on failure.
PHP Version: 5.2+
--- ---
❮ Func Filesystem Filegroup Func Filesystem Flock ❯