Dodo
DOm DOcument implementation
Loading...
Searching...
No Matches
Wikimedia\Dodo\Internal\NamespacePrefixMap Class Reference

A namespace prefix map. More...

Public Member Functions

 __construct ()
 Create a new empty namespace prefix map.
 
bool found (?string $namespace, string $prefix)
 Check if a prefix string is found in a namespace prefix map.
 
 add (?string $namespace, string $prefix)
 Add a prefix string to the namespace prefix map.
 
string recordNamespaceInformation (Element $element, array &$localPrefixMap)
 Record the namespace information for an element, given this namespace prefix map and a local prefixes map.
 
string retrievePreferredPrefix (?string $namespace, ?string $preferredPrefix)
 Retrieve a preferred prefix string.
 
NamespacePrefixMap clone ()
 Copy a namespace prefix map.
 
string generatePrefix (?string $newNamespace, int &$prefixIndex)
 Generate a prefix given a map, a string new namespace, and a reference to a prefix index.
 

Detailed Description

Member Function Documentation

◆ add()

Wikimedia\Dodo\Internal\NamespacePrefixMap::add ( ?string $namespace,
string $prefix )

Add a prefix string to the namespace prefix map.

See also
https://w3c.github.io/DOM-Parsing/#dfn-add
Parameters
?string$namespace
string$prefix

◆ clone()

NamespacePrefixMap Wikimedia\Dodo\Internal\NamespacePrefixMap::clone ( )

Copy a namespace prefix map.

See also
https://w3c.github.io/DOM-Parsing/#dfn-copy-a-namespace-prefix-map
Returns
NamespacePrefixMap

◆ found()

bool Wikimedia\Dodo\Internal\NamespacePrefixMap::found ( ?string $namespace,
string $prefix )

Check if a prefix string is found in a namespace prefix map.

See also
https://w3c.github.io/DOM-Parsing/#dfn-found
Parameters
?string$namespace
string$prefix
Returns
bool

◆ generatePrefix()

string Wikimedia\Dodo\Internal\NamespacePrefixMap::generatePrefix ( ?string $newNamespace,
int & $prefixIndex )

Generate a prefix given a map, a string new namespace, and a reference to a prefix index.

See also
https://w3c.github.io/DOM-Parsing/#generating-namespace-prefixes
Parameters
?string$newNamespace
int&$prefixIndex
Returns
string the generated prefix

◆ recordNamespaceInformation()

string Wikimedia\Dodo\Internal\NamespacePrefixMap::recordNamespaceInformation ( Element $element,
array & $localPrefixMap )

Record the namespace information for an element, given this namespace prefix map and a local prefixes map.

See also
https://w3c.github.io/DOM-Parsing/#dfn-recording-the-namespace-information
Parameters
Element$element
array<string,string>&$localPrefixMap
Returns
?string

◆ retrievePreferredPrefix()

string Wikimedia\Dodo\Internal\NamespacePrefixMap::retrievePreferredPrefix ( ?string $namespace,
?string $preferredPrefix )

Retrieve a preferred prefix string.

See also
https://w3c.github.io/DOM-Parsing/#dfn-retrieving-a-preferred-prefix-string
Parameters
?string$namespace
?string$preferredPrefix
Returns
?string

The documentation for this class was generated from the following file: