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

XMLPARSE ({DOCUMENT | CONTENT} value [PRESERVE | STRIP WHITESPACE]): a string parsed as XML.

Mirrors PostgreSQL's XmlExpr of kind IS_XMLPARSE. Rule: PG-XMLPARSE-001. Facts: xml, NULL exactly when the value is. The result column is named xmlparse. Source: https://www.postgresql.org/docs/17/functions-xml.html#FUNCTIONS-PRODUCING-XML-XMLPARSE. Status: Implemented.

Reading a document parsedoctest
$parse = new \SqlSemantics\Platform\PostgreSql\Statement\Invocation\Xml\XmlParse(\SqlSemantics\Platform\PostgreSql\Statement\Option\XmlOption::Document, new \SqlSemantics\Platform\PostgreSql\Statement\Literal\NullLiteral());
    [$parse->option->value, $parse->whitespace] // => ['DOCUMENT', null]

Properties§

public XmlOption $option
public Scalar $value
public XmlWhitespace|null $whitespace = null

Methods§

public function __construct(
    public XmlOption $option,
    public Scalar $value,
    public XmlWhitespace|null $whitespace = null,
)

Parameters

$optionXmlOptionWhether a document or content is parsed
$valueScalarThe string parsed
$whitespaceXmlWhitespace|nullThe whitespace handling written
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 value, the type and the NULL fact.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

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

Writes XMLPARSE with the option, the value and the whitespace handling.

Parameters

$outOutput
Test cases 1
Calls 2

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 1