class OptimizeChooseAttributes extends AbstractChooseOptimization

Constants

XMLNS_XSL

XSL namespace

Properties

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

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

array
getCommonAttributes()

Get a list of all attribute elements common to all branches

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

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

protected void reset()

Reset this instance's properties after usage

Return Value

void

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

protected array getBranches()

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

Return Value

array

protected bool hasOtherwise()

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

Return Value

bool

protected bool isEmpty()

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

Return Value

bool

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 55
protected void optimizeChoose()

Optimize the current xsl:choose element

Return Value

void

at line 22
protected array getCommonAttributes()

Get a list of all attribute elements common to all branches

Return Value

array