Title: AtomParser::map_xmlns
Published: June 15, 2017
Last modified: May 20, 2026

---

# AtomParser::map_xmlns( indexish $p, array $n ): string

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/atomparser/map_xmlns/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/atomparser/map_xmlns/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/atomparser/map_xmlns/?output_format=md#source)

[ Back to top](https://developer.wordpress.org/reference/classes/atomparser/map_xmlns/?output_format=md#wp--skip-link--target)

Map XML namespace to string.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/atomparser/map_xmlns/?output_format=md#parameters)󠁿

 `$p`indexishrequired

XML Namespace element index

`$n`arrayrequired

Two-element array pair. [ 0 => {namespace}, 1 => {url} ]

## 󠀁[Return](https://developer.wordpress.org/reference/classes/atomparser/map_xmlns/?output_format=md#return)󠁿

 string `'xmlns="{url}"'` or `'xmlns:{namespace}="{url}"'`

## 󠀁[Source](https://developer.wordpress.org/reference/classes/atomparser/map_xmlns/?output_format=md#source)󠁿

    ```php
    public static function map_xmlns($p, $n) {
    	$xd = "xmlns";
    	if( 0 < strlen($n[0]) ) {
    		$xd .= ":{$n[0]}";
    	}
    	return "{$xd}=\"{$n[1]}\"";
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/atomlib.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/atomlib.php#L130)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/atomlib.php#L130-L136)

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fatomparser%2Fmap_xmlns%2F)
before being able to contribute a note or feedback.