Flow PHP

XMLParserExtractor implements BatchableExtractor, Extractor, FileExtractor, MetadataColumnsExtractor, SplittableExtractor

FinalYes

Interfaces

BatchableExtractor
Extractor
FileExtractor
MetadataColumnsExtractor
SplittableExtractor

Methods

__construct()  : mixed
To iterate only over <element> nodes, use `$loader->withXMLNodePath('root/elements/element')`.
batchSize()  : int<1, max>
extract()  : Generator<Signal|null, void>
isRepeatable()  : bool
partitionSchema()  : Schema
partitionTypes()  : static
prunes()  : bool
reader()  : FileSplitReader
refresh()  : void
schema()  : Schema
source()  : Path
splits()  : array<int, FileSplit>
One split per admitted file: a document is a tree with no offset a second reader could start at.
statistics()  : Statistics
withBatchSize()  : static
withBufferSize()  : self
withMetadataColumns()  : static
withSchema()  : static
withXMLNodePath()  : self

Methods

__construct()

To iterate only over <element> nodes, use `$loader->withXMLNodePath('root/elements/element')`.

public __construct(Path $path[, Filesystem $filesystem = new NativeLocalFilesystem() ]) : mixed

XML Node Path does not support attributes and it's not xpath, it is just a sequence of node names separated with slash.

Parameters
$path : Path
$filesystem : Filesystem = new NativeLocalFilesystem()

extract()

public extract(Backend $backend, Criteria $criteria) : Generator<Signal|null, void>
Parameters
$backend : Backend
$criteria : Criteria
Return values
Generator<Signal|null, void>

partitionTypes()

public partitionTypes(PartitionTypes $types) : static
Parameters
$types : PartitionTypes
Return values
static

prunes()

public prunes(ScalarFunction $conjunct) : bool
Parameters
$conjunct : ScalarFunction
Return values
bool

splits()

One split per admitted file: a document is a tree with no offset a second reader could start at.

public splits(Criteria $criteria, int $targetSplitBytes) : array<int, FileSplit>
Parameters
$criteria : Criteria
$targetSplitBytes : int
Return values
array<int, FileSplit>

withBatchSize()

public withBatchSize(int $batchSize) : static
Parameters
$batchSize : int
Return values
static

withBufferSize()

public withBufferSize(int<1, max> $bufferSize) : self
Parameters
$bufferSize : int<1, max>

$bufferSize - size of the chunks to read from the xml file. Bigger chunks means faster reading but more memory usage.

Return values
self

withMetadataColumns()

public withMetadataColumns(bool $addMetadataColumns) : static
Parameters
$addMetadataColumns : bool
Return values
static

withSchema()

public withSchema(Schema $schema) : static
Parameters
$schema : Schema
Tags
throws
InvalidArgumentException

when $schema has no "node" column, the one the matched elements are read into

Return values
static

withXMLNodePath()

public withXMLNodePath(string $xmlNodePath) : self
Parameters
$xmlNodePath : string
Return values
self
On this page

Search results