protected static function removeInvalidAttributes(DOMDocument $dom)
	{
		$xpath = new DOMXPath($dom);
		foreach ($xpath->query('//@*') as $attribute)
		{
			if (!preg_match('(^(?:[-\\w]+:)?(?!\\d)[-\\w]+$)D', $attribute->nodeName))
			{
				$attribute->parentNode->removeAttributeNode($attribute);
			}
		}
	}
protected static function removeInvalidAttributes(DOMDocument $dom)
	{
		$xpath = new DOMXPath($dom);
		foreach ($xpath->query('//@*') as $attribute)
		{
			if (!preg_match('(^(?:[-\\w]+:)?(?!\\d)[-\\w]+$)D', $attribute->nodeName))
			{
				$attribute->parentNode->removeAttributeNode($attribute);
			}
		}
	}
protected static function removeInvalidAttributes ( DOMDocument $ dom ) { $ xpath = new DOMXPath ( $ dom ) ; foreach ( $ xpath -> query ( '//@*' ) as $ attribute ) { if ( ! preg_match ( '(^(?:[-\\w]+:)?(?!\\d)[-\\w]+$)D' , $ attribute -> nodeName ) ) { $ attribute -> parentNode -> removeAttributeNode ( $ attribute ) ; } } }
Remove attributes with an invalid name from given DOM document

@param  DOMDocument $dom
@return void
Remove attributes with an invalid name from given DOM document