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()
batchSize()
public
batchSize() : int<1, max>
Return values
int<1, max>extract()
public
extract(Backend $backend, Criteria $criteria) : Generator<Signal|null, void>
Parameters
- $backend : Backend
- $criteria : Criteria
Return values
Generator<Signal|null, void>isRepeatable()
public
isRepeatable() : bool
Return values
boolpartitionSchema()
public
partitionSchema() : Schema
Return values
SchemapartitionTypes()
public
partitionTypes(PartitionTypes $types) : static
Parameters
- $types : PartitionTypes
Return values
staticprunes()
public
prunes(ScalarFunction $conjunct) : bool
Parameters
- $conjunct : ScalarFunction
Return values
boolreader()
public
reader() : FileSplitReader
Return values
FileSplitReaderrefresh()
public
refresh() : void
schema()
public
schema() : Schema
Return values
Schemasource()
public
source() : Path
Return values
Pathsplits()
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>statistics()
public
statistics() : Statistics
Return values
StatisticswithBatchSize()
public
withBatchSize(int $batchSize) : static
Parameters
- $batchSize : int
Return values
staticwithBufferSize()
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
selfwithMetadataColumns()
public
withMetadataColumns(bool $addMetadataColumns) : static
Parameters
- $addMetadataColumns : bool
Return values
staticwithSchema()
public
withSchema(Schema $schema) : static
Parameters
- $schema : Schema
Tags
Return values
staticwithXMLNodePath()
public
withXMLNodePath(string $xmlNodePath) : self
Parameters
- $xmlNodePath : string