classXmlRoot
final class XmlRoot
implements Scalar, OutputNaming
uses Snapshot
Public API: explicitly declared with
@visibility public.XMLROOT (value, VERSION {version | NO VALUE} [, STANDALONE {YES | NO | NO VALUE}]): an XML value with a new root declaration.
Mirrors PostgreSQL's XmlExpr of kind IS_XMLROOT. Rule: PG-XMLROOT-001. Facts: xml; NULL exactly when the value is. The result column is named xmlroot. Source: https://www.postgresql.org/docs/17/functions-xml.html#FUNCTIONS-PRODUCING-XML-XMLROOT. Status: Implemented.
$root = new \SqlSemantics\Platform\PostgreSql\Statement\Invocation\Xml\XmlRoot(new \SqlSemantics\Platform\PostgreSql\Statement\Literal\NullLiteral(), null, \SqlSemantics\Platform\PostgreSql\Statement\Invocation\Xml\XmlStandalone::Yes);
[$root->version, $root->standalone->value] // => [null, 'YES']Properties§
public Scalar $valuepublic Scalar|null $version = nullpublic XmlStandalone|null $standalone = nullMethods§
public function __construct(
public Scalar $value,
public Scalar|null $version = null,
public XmlStandalone|null $standalone = null,
)Parameters
$value | Scalar | The XML value |
$version | Scalar|null | The version; null for VERSION NO VALUE |
$standalone | XmlStandalone|null | The standalone declaration written |
public function outputName(): NameNames an unaliased result column.
Returns
Test cases 1
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactDerives the value and the version, the type and the NULL fact.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 5
- method-call Derivation::scalar() line 59
- new ScalarFact line 64
- new Known line 64
- class-const Builtin::Xml() line 64
- class-const Nullability::Nullable() line 64
public function render(Output $out): voidWrites XMLROOT with the value, the version and the standalone declaration.
Parameters
$out | Output |
Test cases 1
Calls 4
- method-call Output::keyword() line 72
- method-call Output::node() line 76
- method-call Output::symbol() line 79
- function-call
explodeline 79
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.