protected static function serializeAttributes(array $attributes)
	{
		$xml = '';
		ksort($attributes);
		foreach ($attributes as $attrName => $attrValue)
		{
			$xml .= ' ' . htmlspecialchars($attrName, ENT_QUOTES) . '="' . htmlspecialchars($attrValue, ENT_COMPAT) . '"';
		}

		// Normalize control characters to what the parser would normally produce
		$xml = preg_replace('/\\r\\n?/', "\n", $xml);
		$xml = preg_replace('/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]+/S', '', $xml);
		$xml = str_replace("\n", '&#10;', $xml);

		return self::encodeUnicodeSupplementaryCharacters($xml);
	}
protected static function serializeAttributes(array $attributes)
	{
		$xml = '';
		ksort($attributes);
		foreach ($attributes as $attrName => $attrValue)
		{
			$xml .= ' ' . htmlspecialchars($attrName, ENT_QUOTES) . '="' . htmlspecialchars($attrValue, ENT_COMPAT) . '"';
		}

		// Normalize control characters to what the parser would normally produce
		$xml = preg_replace('/\\r\\n?/', "\n", $xml);
		$xml = preg_replace('/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]+/S', '', $xml);
		$xml = str_replace("\n", '&#10;', $xml);

		return self::encodeUnicodeSupplementaryCharacters($xml);
	}
protected static function serializeAttributes ( array $ attributes ) { $ xml = '' ; ksort ( $ attributes ) ; foreach ( $ attributes as $ attrName => $ attrValue ) { $ xml .= ' ' . htmlspecialchars ( $ attrName , ENT_QUOTES ) . '="' . htmlspecialchars ( $ attrValue , ENT_COMPAT ) . '"' ; } // Normalize control characters to what the parser would normally produce $ xml = preg_replace ( '/\\r\\n?/' , "\n" , $ xml ) ; $ xml = preg_replace ( '/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]+/S' , '' , $ xml ) ; $ xml = str_replace ( "\n" , '&#10;' , $ xml ) ; return self :: encodeUnicodeSupplementaryCharacters ( $ xml ) ; }
Serialize an array of attribute values

@param  array  $attributes Associative array of attribute values
@return string             Attributes, sorted by name and serialized to XML
Serialize an array of attribute values