AtomParser::map_xmlns() WordPress Method
The AtomParser::map_xmlns() method in Wordpress allows developers to map XML namespaces to their own prefixes. This is useful when working with XML documents that have multiple namespaces defined. By mapping the namespaces to their own prefixes, developers can access the data in the XML document more easily.
AtomParser::map_xmlns( indexish $p, array $n ) #
Map XML namespace to string.
Contents
Parameters
- $p
(indexish)(Required)XML Namespace element index
- $n
(array)(Required)Two-element array pair. [ 0 => {namespace}, 1 => {url} ]
Return
(string) 'xmlns="{url}"' or 'xmlns:{namespace}="{url}"'
Source
File: wp-includes/atomlib.php
public static function map_xmlns($p, $n) { $xd = "xmlns"; if( 0 < strlen($n[0]) ) { $xd .= ":{$n[0]}"; } return "{$xd}=\"{$n[1]}\""; }
Expand full source codeCollapse full source codeView on TracView on GitHub