Utils
abstract class Utils
Methods
Return every value used in given attribute from given tag
Replace Unicode characters outside the BMP with XML entities
Strip the formatting of an intermediate representation and return plain text
Remove all tags at given nesting level
Replace the attributes of all tags of given name in given XML
Encode given Unicode character into an XML entity
Create a return a new DOMDocument loaded with given XML
Parse the attributes contained in given XML
Serialize an array of attribute values
Details
at line 25
static string[]
getAttributeValues(string $xml, string $tagName, string $attrName)
Return every value used in given attribute from given tag
Will include duplicate values
at line 47
static string
encodeUnicodeSupplementaryCharacters(string $str)
Replace Unicode characters outside the BMP with XML entities
at line 64
static string
removeFormatting(string $xml)
Strip the formatting of an intermediate representation and return plain text
This will remove start tags and end tags but will keep the text content of everything else
at line 84
static string
removeTag(string $xml, string $tagName, int $nestingLevel = 0)
Remove all tags at given nesting level
at line 112
static string
replaceAttributes(string $xml, string $tagName, callable $callback)
Replace the attributes of all tags of given name in given XML
at line 141
static protected string
encodeUnicodeSupplementaryCharactersCallback(array $m)
Encode given Unicode character into an XML entity
at line 155
static protected DOMDocument
loadXML(string $xml)
Create a return a new DOMDocument loaded with given XML
at line 172
static protected array
parseAttributes(string $xml)
Parse the attributes contained in given XML
at line 193
static protected string
saveXML(DOMDocument $dom)
Serialize given DOMDocument
at line 204
static protected string
serializeAttributes(array $attributes)
Serialize an array of attribute values