Complete PHP SimpleXML Reference
The registerXPathNamespace() registers a namespace context for the next XPath query.
This function is useful if a namespace prefix is changed in an XML document. The registerXPathNamespace() function will create a prefix for specified namespace, so that the affected XML nodes can be accessed without altering the application code too much.
| Parameter | Description |
|---|---|
| prefix | Required. Specifies the namespace prefix |
| ns | Required. Specifies the namespace URL. This must match a namespace in the XML document. |
XML File
PHP Code
The output of the code above will be:
Complete PHP SimpleXML Reference
Your message has been sent to W3Schools.