classXmlParse
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.
$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 $optionpublic Scalar $valuepublic XmlWhitespace|null $whitespace = nullMethods§
public function __construct(
public XmlOption $option,
public Scalar $value,
public XmlWhitespace|null $whitespace = null,
)Parameters
$option | XmlOption | Whether a document or content is parsed |
$value | Scalar | The string parsed |
$whitespace | XmlWhitespace|null | The whitespace handling written |
public function outputName(): NameNames an unaliased result column.
Returns
Test cases 1
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactDerives the value, the type and the NULL fact.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 5
- method-call Derivation::scalar() line 60
- new ScalarFact line 62
- new Known line 62
- class-const Builtin::Xml() line 62
- class-const Nullability::Nullable() line 62
public function render(Output $out): voidWrites XMLPARSE with the option, the value and the whitespace handling.
Parameters
$out | Output |
Test cases 1
Calls 2
- method-call Output::keyword() line 70
- method-call Output::symbol() line 74
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.