classXmlElement
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.
$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> $attributespublic list<Scalar> $contentpublic Name $nameMethods§
public function __construct(
public Name $name,
list<XmlAttribute> $attributes = [],
list<Scalar> $content = [],
)Parameters
$name | Name | The element name |
$attributes | list<XmlAttribute> | The attributes; none when XMLATTRIBUTES is not written |
$content | list<Scalar> | The content values |
Calls 3
- static-call Check::listOf() line 57
- class-const XmlAttribute::class() line 57
- class-const Scalar::class() line 58
public function outputName(): NameNames an unaliased result column.
Returns
Test cases 1
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactDerives the attributes and the content, and reports misnamed attributes.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 7
- method-call Derivation::scalar() line 78
- method-call XmlChecks::attributes() line 80
- new XmlChecks line 80
- new ScalarFact line 82
- new Known line 82
- class-const Builtin::Xml() line 82
- class-const Nullability::NotNull() line 82
public function render(Output $out): voidWrites XMLELEMENT with the name, the attributes and the content.
Parameters
$out | Output |
Test cases 1
Calls 3
- method-call Output::keyword() line 90
- class-const NameUse::Label() line 90
- method-call Output::symbol() line 92
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Relations§
Instantiated in 4
- new SqlSemantics\Platform\PostgreSql\Lowering\Invocation\XmlRule::expression() packages/sql-semantics-postgres/src/Lowering/Invocation/XmlRule.php:99
- new SqlSemantics\Platform\PostgreSql\Lowering\Invocation\XmlRule::expression() packages/sql-semantics-postgres/src/Lowering/Invocation/XmlRule.php:100
- new SqlSemantics\Platform\PostgreSql\Lowering\Invocation\XmlRule::expression() packages/sql-semantics-postgres/src/Lowering/Invocation/XmlRule.php:101
- new SqlSemantics\Platform\PostgreSql\Lowering\Invocation\XmlRule::expression() packages/sql-semantics-postgres/src/Lowering/Invocation/XmlRule.php:102