abstract class AbstractChooseOptimization extends AbstractNormalization

Constants

XMLNS_XSL

XSL namespace

Properties

protected Document $ownerDocument from  AbstractNormalization
protected array $queries {@inheritdoc}
protected Element $choose

Methods

void
normalize(Element $template)

Apply this normalization rule to given template

Text
createPolymorphicText(string $textContent)

Create an xsl:text element or a text node in current template

array
getNodes()

Query and return a list of nodes of interest

bool
isXsl(DOMNode $node, string $localName = null)

Test whether given node is an XSL element

string
lowercase(string $str)

Make an ASCII string lowercase

void
normalizeAttribute(Attr $attribute)

No description

void
normalizeCdataSection(CdataSection $comment)

No description

void
normalizeComment(Comment $comment)

No description

void
normalizeElement(Element $element)

No description

void
normalizeNode(DOMNode $node)

No description

void
normalizeText(Text $node)

No description

void
reset()

Reset this instance's properties after usage

array
getAttributes(Element $element)

Retrieve a list of attributes from given element

array
getBranches()

Return a list the xsl:when and xsl:otherwise children of current xsl:choose element

bool
hasOtherwise()

Test whether current xsl:choose element has an xsl:otherwise child

bool
isEmpty()

Test whether current xsl:choose element has no content besides xsl:when and xsl:otherwise

bool
isEqualTag(Element $el1, Element $el2)

Test whether two elements have the same start tag

void
optimizeChoose()

Optimize the current xsl:choose element

Details

void normalize(Element $template)

Apply this normalization rule to given template

Parameters

Element $template

node

Return Value

void

protected Text createPolymorphicText(string $textContent)

Create an xsl:text element or a text node in current template

Parameters

string $textContent

Return Value

Text

protected array getNodes()

Query and return a list of nodes of interest

Return Value

array

protected bool isXsl(DOMNode $node, string $localName = null)

Test whether given node is an XSL element

Parameters

DOMNode $node
string $localName

Return Value

bool

protected string lowercase(string $str)

Make an ASCII string lowercase

Parameters

string $str

Original string

Return Value

string

Lowercased string

protected void normalizeAttribute(Attr $attribute)

No description

Parameters

Attr $attribute

Return Value

void

protected void normalizeCdataSection(CdataSection $comment)

No description

Parameters

CdataSection $comment

Return Value

void

protected void normalizeComment(Comment $comment)

No description

Parameters

Comment $comment

Return Value

void

at line 87
protected void normalizeElement(Element $element)

No description

Parameters

Element $element

Return Value

void

protected void normalizeNode(DOMNode $node)

No description

Parameters

DOMNode $node

Return Value

void

protected void normalizeText(Text $node)

No description

Parameters

Text $node

Return Value

void

at line 103
protected void reset()

Reset this instance's properties after usage

Return Value

void

at line 30
protected array getAttributes(Element $element)

Retrieve a list of attributes from given element

Parameters

Element $element

Return Value

array

NamespaceURI#nodeName as keys, attribute values as values

at line 47
protected array getBranches()

Return a list the xsl:when and xsl:otherwise children of current xsl:choose element

Return Value

array

at line 57
protected bool hasOtherwise()

Test whether current xsl:choose element has an xsl:otherwise child

Return Value

bool

at line 67
protected bool isEmpty()

Test whether current xsl:choose element has no content besides xsl:when and xsl:otherwise

Return Value

bool

at line 79
protected bool isEqualTag(Element $el1, Element $el2)

Test whether two elements have the same start tag

Parameters

Element $el1
Element $el2

Return Value

bool

at line 98
abstract protected void optimizeChoose()

Optimize the current xsl:choose element

Return Value

void