classXmlSerialize
final class XmlSerialize
implements Scalar, OutputNaming
uses Snapshot
@visibility public.XMLSERIALIZE ({DOCUMENT | CONTENT} value AS type [[NO] INDENT]): an XML value as a character string.
Mirrors PostgreSQL's XmlSerialize node; the type is a simple type name without an array part. Rule: PG-XMLSERIALIZE-001. Facts: the type named, NULL exactly when the value is. Diagnostics: a type that is not a character string type (PG-XML-CHECKS-001). The result column is named xmlserialize. Source: https://www.postgresql.org/docs/17/functions-xml.html#FUNCTIONS-XML-SERIALIZE. Status: Implemented.
$serialize = new \SqlSemantics\Platform\PostgreSql\Statement\Invocation\Xml\XmlSerialize(
\SqlSemantics\Platform\PostgreSql\Statement\Option\XmlOption::Content,
new \SqlSemantics\Platform\PostgreSql\Statement\Literal\NullLiteral(),
new \SqlSemantics\Platform\PostgreSql\Statement\Type\TypeName(new \SqlSemantics\Platform\PostgreSql\Statement\Type\Designation\NamedDesignation(new \SqlSemantics\Platform\PostgreSql\Statement\Name\DottedName([new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('text')]))),
\SqlSemantics\Platform\PostgreSql\Statement\Invocation\Xml\XmlIndent::Indent,
);
[$serialize->option->value, $serialize->indent->value] // => ['CONTENT', 'INDENT']Properties§
public XmlOption $optionpublic Scalar $valuepublic TypeName $typepublic XmlIndent|null $indent = nullMethods§
public function outputName(): NameNames an unaliased result column.
Returns
Test cases 1
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactDerives the value and the type's modifiers, the type and the NULL fact.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 7
- method-call Derivation::scalar() line 68
- method-call TypeName::deriveClause() line 69
- method-call XmlChecks::serialized() line 70
- new XmlChecks line 70
- method-call TypeName::typeFact() line 70
- new ScalarFact line 72
- class-const Nullability::Nullable() line 72
public function render(Output $out): voidWrites XMLSERIALIZE with the option, the value, the type and the indentation.
Parameters
$out | Output |
Test cases 1
Calls 3
- method-call Output::keyword() line 80
- function-call
explodeline 82 - method-call Output::symbol() line 84
Test cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.