final class XmlElement
    implements Scalar, OutputNaming
    uses Snapshot
Public API: explicitly declared with @visibility public.

XMLELEMENT (NAME name [, XMLATTRIBUTES (attributes)] [, content]): an XML element.

Mirrors PostgreSQL's XmlExpr of kind IS_XMLELEMENT. Rule: PG-XMLELEMENT-001. Facts: xml, not NULL. Diagnostics: an unnamed attribute that is not a column reference, and an attribute name used twice (PG-XML-CHECKS-001). The result column is named xmlelement. Source: https://www.postgresql.org/docs/17/functions-xml.html#FUNCTIONS-PRODUCING-XML-XMLELEMENT. Status: Implemented.

Reading an empty elementdoctest
$element = new \SqlSemantics\Platform\PostgreSql\Statement\Invocation\Xml\XmlElement(new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('br'));
    [$element->name->value, $element->attributes, $element->content] // => ['br', [], []]

Properties§

public list<XmlAttribute> $attributes
public list<Scalar> $content
public Name $name

Methods§

public function __construct(
    public Name $name,
    list<XmlAttribute> $attributes = [],
    list<Scalar> $content = [],
)

Parameters

$nameNameThe element name
$attributeslist<XmlAttribute>The attributes; none when XMLATTRIBUTES is not written
$contentlist<Scalar>The content values
Calls 3
public function outputName(): Name

Names an unaliased result column.

Returns

Test cases 1
Calls 1
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives the attributes and the content, and reports misnamed attributes.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

Calls 7
public function render(Output $out): void

Writes XMLELEMENT with the name, the attributes and the content.

Parameters

$outOutput
Test cases 1
Calls 3

Test cases 3§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 3

Relations§

Instantiated in 4