depage-xmldb v2.3.1
XML documents in a relational database
Loading...
Searching...
No Matches
XpathElement Class Reference

Detailed Description

All parsing logic (condition, position, attributes) is encapsulated in the constructor so that callers (e.g. XmlDb::getNodeIdsByXpath) never need to call XpathParser helpers again — they only read pre-computed properties.

The parser itself remains SQL-agnostic; the caller is responsible for assembling SQL fragments from the pre-parsed data.

Definition at line 17 of file XpathElement.php.

Public Member Functions

 __construct (string $divider, string $namespace, string $name, string $condition)

Data Fields

readonly string $divider
readonly string $namespace
readonly string $name
readonly string $condition
readonly mixed $position
readonly mixed $attributes
readonly bool $attributesValid

Protected Member Functions

 parsePosition ($condition)
 getConditionAttributes ($conditionString, $strings)
 removeLiteralStrings ($text, &$strings)

Constructor & Destructor Documentation

◆ __construct()

__construct ( string $divider,
string $namespace,
string $name,
string $condition )
Parameters
string$dividerdivider character
string$namespacenamespace prefix
string$namenode name
string$conditioncondition string

Definition at line 36 of file XpathElement.php.

Member Function Documentation

◆ getConditionAttributes()

getConditionAttributes ( $conditionString,
$strings )
protected
Parameters
string$conditionStringcleaned condition string
array$stringsextracted literal strings
Returns
array parsed condition rows
Exceptions
XmlDbExceptionon invalid syntax

Definition at line 96 of file XpathElement.php.

◆ parsePosition()

parsePosition ( $condition)
protected
Parameters
string$conditioncondition string
Returns
false|array parsed position data or false

Definition at line 75 of file XpathElement.php.

◆ removeLiteralStrings()

removeLiteralStrings ( $text,
& $strings )
protected
Parameters
string$textinput text
array&$stringsreference to populate with extracted literals
Returns
string text with string literals replaced by placeholders

Definition at line 132 of file XpathElement.php.

Field Documentation

◆ $attributes

readonly mixed $attributes

Definition at line 27 of file XpathElement.php.

◆ $attributesValid

readonly bool $attributesValid

Definition at line 28 of file XpathElement.php.

◆ $condition

readonly string $condition

Definition at line 23 of file XpathElement.php.

◆ $divider

readonly string $divider

Definition at line 20 of file XpathElement.php.

◆ $name

readonly string $name

Definition at line 22 of file XpathElement.php.

◆ $namespace

readonly string $namespace

Definition at line 21 of file XpathElement.php.

◆ $position

readonly mixed $position

Definition at line 26 of file XpathElement.php.


The documentation for this class was generated from the following file: