final class XmlHelpers

internal  
 

Runtime utilities for handling XML.

Constants

private ReNameStart

private ReName

Methods

static string
escapeText(mixed $s)

Escapes string for use everywhere inside XML (except for comments and tags).

static string
escapeAttr(mixed $s)

Escapes string for use inside XML attribute value.

static string
escapeTag(mixed $s)

Escapes string for use inside XML tag.

static string
formatAttribute(string $namePart, mixed $value, bool $migrationWarnings = false)

Formats an XML attribute.

static string
validateTagChange(mixed $name, string|null $origName = null)

Checks that the HTML tag name can be changed.

static void
validateAttributeName(mixed $name)

Validates that the XML attribute name is a valid XML Name.

Details

at line 30
static string escapeText(mixed $s)

Escapes string for use everywhere inside XML (except for comments and tags).

Parameters

mixed $s

Return Value

string

at line 47
static string escapeAttr(mixed $s)

Escapes string for use inside XML attribute value.

Parameters

mixed $s

Return Value

string

at line 59
static string escapeTag(mixed $s)

Escapes string for use inside XML tag.

Parameters

mixed $s

Return Value

string

at line 73
static string formatAttribute(string $namePart, mixed $value, bool $migrationWarnings = false)

Formats an XML attribute.

Parameters

string $namePart
mixed $value
bool $migrationWarnings

Return Value

string

at line 89
static string validateTagChange(mixed $name, string|null $origName = null)

Checks that the HTML tag name can be changed.

Parameters

mixed $name
string|null $origName

Return Value

string

at line 105
static void validateAttributeName(mixed $name)

Validates that the XML attribute name is a valid XML Name.

Parameters

mixed $name

Return Value

void