| Title: | Rectangle Arbitrary 'XML' into Analysis-Friendly Tables |
|---|---|
| Description: | Converts arbitrary 'XML' into canonical node tables and analysis-friendly rectangular outputs without requiring a vocabulary-specific parser. Supports conservative structure proposals, explicit reusable profiles, advisory 'XSD' inspection, bounded streaming, 'CSV' and 'Parquet' output, an analyst-oriented single-table projection, and record-level parallel execution with automatic scheduling. The native implementation uses 'libxml2' for structural acceleration while the 'R' implementation remains the semantic reference. |
| Authors: | Lorenzo Isella [aut, cre] |
| Maintainer: | Lorenzo Isella <lorenzo.isella@gmail.com> |
| License: | GPL-3 |
| Version: | 0.1.0 |
| Built: | 2026-09-28 16:22:33 UTC |
| Source: | https://github.com/cran/xmlrectr |
Convert arbitrary XML into canonical node tables and analysis-friendly rectangles with explicit profiles, bounded streaming, optional native acceleration, and automatic record-level parallel execution.
The normal workflow is proposal, review, profile, compilation, and rectangling. For exploratory work, the analyst layer provides a self-contained single-table projection. See the package README and vignettes for complete workflows.
propose_xml_profile(), xml_profile(), rectangle_xml(),
rectangle_xml_analyst()
Discover structural evidence and define a reviewable, reusable extraction contract. Proposals and XSD evidence are advisory rather than silently executable.
as_xml_profile(x)as_xml_profile(x)
x |
An existing |
An object of class xml_profile. The returned named list is a validated portable
profile representation suitable for compilation, serialization, and reuse.
xml_profile(), rectangle_xml()
Discover structural evidence and define a reviewable, reusable extraction contract. Proposals and XSD evidence are advisory rather than silently executable.
compile_xml_profile( profile, sample, whitespace = c("drop_blank", "preserve"))compile_xml_profile( profile, sample, whitespace = c("drop_blank", "preserve"))
profile |
A human-facing profile created by |
sample |
A representative XML sample accepted by |
whitespace |
How blank text nodes are handled while inspecting the sample: |
An object of class xml_rect_spec. It is an executable, namespace-aware rectangle
specification resolved against sample and includes the originating validated
xml_profile in its profile component.
xml_profile(), rectangle_xml()
Work with the canonical XML-node representation that preserves node identity, parentage, source order, namespaces, node types and scalar values.
inspect_xml( x, whitespace = c("drop_blank", "preserve"))inspect_xml( x, whitespace = c("drop_blank", "preserve"))
x |
An XML file path or an existing canonical node table. |
whitespace |
How blank text nodes are handled when an XML file is read. |
An object of class xml_structure, implemented as a list containing the source,
whitespace policy, canonical node table, namespace-aware structural index, and likely
record paths. It represents reviewable structural evidence about the XML sample.
xml_profile(), rectangle_xml()
Discover structural evidence and define a reviewable, reusable extraction contract. Proposals and XSD evidence are advisory rather than silently executable.
inspect_xsd(xsd)inspect_xsd(xsd)
xsd |
Path to an XML Schema (XSD) file to inspect as advisory structural evidence. |
This is deliberately an advisory XSD inspection layer, not a complete XSD validator or resolver.
An object of class xml_xsd_inspection, implemented as a list containing the
schema source, target namespace, a declaration tibble, and explicit inspection
limitations. It represents advisory evidence from directly declared XSD elements and
attributes rather than a complete schema validation result.
xml_profile(), rectangle_xml()
Discover structural evidence and define a reviewable, reusable extraction contract. Proposals and XSD evidence are advisory rather than silently executable.
make_rectangle( structure, one_row_per = NULL, namespace = NULL, identify_by = NULL, fields = NULL, types = NULL, representation = c("auto", "wide", "long"))make_rectangle( structure, one_row_per = NULL, namespace = NULL, identify_by = NULL, fields = NULL, types = NULL, representation = c("auto", "wide", "long"))
structure |
An inspected XML structure returned by |
one_row_per |
Optional visible element name or path defining one output record. If omitted, an unambiguous proposed record path is used. |
namespace |
Optional namespace URI used to disambiguate the row element. |
identify_by |
Optional visible value name or path used as the record identifier; omit to generate sequential identifiers. |
fields |
Optional character vector of values to retain. Named entries rename output columns. |
types |
Optional named character vector declaring output types for selected fields. |
representation |
Requested table representation: automatic safe choice, wide, or long. |
An object of class xml_rect_spec, implemented as a list describing the resolved
record path, identifier rule, representation, repeated paths, field mapping, and field
catalogue. It is an executable rectangle specification compiled from the inspected
structure.
xml_profile(), rectangle_xml()
Discover structural evidence and define a reviewable, reusable extraction contract. Proposals and XSD evidence are advisory rather than silently executable.
propose_xml_profile( sample, rows = NULL, namespace = NULL, xsd = NULL, whitespace = c("drop_blank", "preserve"))propose_xml_profile( sample, rows = NULL, namespace = NULL, xsd = NULL, whitespace = c("drop_blank", "preserve"))
sample |
An XML sample accepted by |
rows |
Optional visible row element name or path to evaluate instead of relying only on automatic row candidates. |
namespace |
Optional namespace URI used to disambiguate row candidates. |
xsd |
Optional XSD file whose directly declared structure is added as advisory evidence. |
whitespace |
How blank text nodes are handled while inspecting the XML sample. |
The returned proposal is review-only and is not an executable profile.
An object of class xml_profile_proposal, implemented as a review-only list
containing ranked row candidates, identifier candidates, field candidates, optional XSD
evidence, and a portable profile template when a row structure can be proposed. It is
not an executable xml_profile.
xml_profile(), rectangle_xml()
Discover structural evidence and define a reviewable, reusable extraction contract. Proposals and XSD evidence are advisory rather than silently executable.
read_xml_profile( file, format = c("auto", "json", "yaml"))read_xml_profile( file, format = c("auto", "json", "yaml"))
file |
Path to a serialized XML profile. |
format |
Profile serialization format. |
An object of class xml_profile, reconstructed and validated from the serialized
JSON or YAML representation.
xml_profile(), rectangle_xml()
Discover structural evidence and define a reviewable, reusable extraction contract. Proposals and XSD evidence are advisory rather than silently executable.
rectangle_spec( sample, one_row_per = NULL, namespace = NULL, identify_by = NULL, fields = NULL, types = NULL, representation = c("auto", "wide", "long"), whitespace = c("drop_blank", "preserve"))rectangle_spec( sample, one_row_per = NULL, namespace = NULL, identify_by = NULL, fields = NULL, types = NULL, representation = c("auto", "wide", "long"), whitespace = c("drop_blank", "preserve"))
sample |
An XML sample accepted by |
one_row_per |
Optional visible element name or path defining one output record. |
namespace |
Optional namespace URI used to disambiguate the row element. |
identify_by |
Optional visible value name or path used as the record identifier. |
fields |
Optional character vector of values to retain. Named entries rename output columns. |
types |
Optional named character vector declaring output types for selected fields. |
representation |
Requested table representation: automatic safe choice, wide, or long. |
whitespace |
How blank text nodes are handled when the sample is read. |
An object of class xml_rect_spec. It is the executable rectangle specification
obtained by inspecting sample and resolving the requested row, identifier, field,
type, and representation choices.
xml_profile(), rectangle_xml()
Apply an explicit profile/specification while preserving repeated values and output order. Parallelism is an execution option of the same public workflow.
rectangle_xml( file, spec, whitespace = NULL, parallel = FALSE, workers = NULL, strategy = "auto", chunk_records = NULL, task_records = NULL, progress = FALSE)rectangle_xml( file, spec, whitespace = NULL, parallel = FALSE, workers = NULL, strategy = "auto", chunk_records = NULL, task_records = NULL, progress = FALSE)
file |
Path to the XML file to rectangle in memory. |
spec |
A compiled rectangle specification or an |
whitespace |
Optional blank-text policy. When omitted, the policy stored in the specification/profile is used. |
parallel |
Execution mode: |
workers |
Optional positive number of parallel workers. When omitted, a balanced default is chosen. |
strategy |
Parallel scheduling strategy. |
chunk_records |
Optional number of complete records in an outer processing chunk. |
task_records |
Optional number of records assigned to each inner parallel task. |
progress |
Logical; whether to emit progress events through progressr for supported in-memory parallel execution. |
Use parallel = FALSE for the exact sequential path, parallel = TRUE to request tuned parallel defaults, or parallel = "auto" to let the engine avoid parallel overhead on small in-memory workloads.
A tibble containing the rectangular analytical result for file, with the same
single-table atomic-column contract as xml_rectangle(). Its columns and wide/long
structure are determined by the supplied profile or compiled specification.
xml_profile(), rectangle_xml()
Create or work with the exploratory single-table analyst projection, which keeps universal xml_* provenance/entity columns alongside atomic analytical values.
rectangle_xml_analyst( file, whitespace = c("drop_blank", "preserve"), infer_types = TRUE, include_misc = TRUE)rectangle_xml_analyst( file, whitespace = c("drop_blank", "preserve"), infer_types = TRUE, include_misc = TRUE)
file |
Path to the XML file. |
whitespace |
How blank text nodes are handled. |
infer_types |
Logical; whether conservative scalar type inference is applied to analyst data columns. |
include_misc |
Logical; whether miscellaneous XML content/provenance columns are retained. |
A tibble in the same self-contained analyst-table format as xml_analyst_table():
one row per emitted XML entity occurrence, xml_* provenance/entity columns,
atomic analytical columns, and the xml_analyst_metadata attribute.
xml_profile(), rectangle_xml()
Create or work with the exploratory single-table analyst projection, which keeps universal xml_* provenance/entity columns alongside atomic analytical values.
rectangle_xml_analyst_csv( file, output, whitespace = c("drop_blank", "preserve"), infer_types = TRUE, include_misc = TRUE, na = "\\N", overwrite = FALSE)rectangle_xml_analyst_csv( file, output, whitespace = c("drop_blank", "preserve"), infer_types = TRUE, include_misc = TRUE, na = "\\N", overwrite = FALSE)
file |
Path to the XML file. |
output |
Destination CSV file. |
whitespace |
How blank text nodes are handled. |
infer_types |
Logical; whether conservative scalar type inference is applied. |
include_misc |
Logical; whether miscellaneous XML content/provenance columns are retained. |
na |
Character string written for missing values. |
overwrite |
Logical; whether an existing destination may be replaced. |
Invisibly, the analyst-table tibble that was written to output. The side effect
is transactional publication of that same table as one CSV file.
xml_profile(), rectangle_xml()
Create or work with the exploratory single-table analyst projection, which keeps universal xml_* provenance/entity columns alongside atomic analytical values.
rectangle_xml_analyst_parquet( file, output, whitespace = c("drop_blank", "preserve"), infer_types = TRUE, include_misc = TRUE, overwrite = FALSE, compression = "snappy")rectangle_xml_analyst_parquet( file, output, whitespace = c("drop_blank", "preserve"), infer_types = TRUE, include_misc = TRUE, overwrite = FALSE, compression = "snappy")
file |
Path to the XML file. |
output |
Destination Parquet file. |
whitespace |
How blank text nodes are handled. |
infer_types |
Logical; whether conservative scalar type inference is applied. |
include_misc |
Logical; whether miscellaneous XML content/provenance columns are retained. |
overwrite |
Logical; whether an existing destination may be replaced. |
compression |
Parquet compression codec passed to arrow. |
Invisibly, the analyst-table tibble that was written to output. The side effect
is transactional publication of that same table as one Parquet file.
xml_profile(), rectangle_xml()
Apply an explicit profile/specification while preserving repeated values and output order. Parallelism is an execution option of the same public workflow.
rectangle_xml_csv( file, spec, output, overwrite = FALSE, document_id = NULL, whitespace = NULL, chunk_rows = 100000L, batch_rows = 100000L, id_check = c("memory", "none"), parallel = FALSE, workers = NULL, strategy = "auto", chunk_records = NULL, task_records = NULL)rectangle_xml_csv( file, spec, output, overwrite = FALSE, document_id = NULL, whitespace = NULL, chunk_rows = 100000L, batch_rows = 100000L, id_check = c("memory", "none"), parallel = FALSE, workers = NULL, strategy = "auto", chunk_records = NULL, task_records = NULL)
file |
Path to the XML file. |
spec |
A compiled rectangle specification. |
output |
Destination CSV file. |
overwrite |
Logical; whether an existing destination may be replaced. |
document_id |
Optional identifier attached to canonical rows; by default it is derived from the input file. |
whitespace |
Optional blank-text policy; when omitted, the specification policy is used. |
chunk_rows |
Positive number controlling the canonical SAX node-buffer capacity. |
batch_rows |
Maximum number of rectangled rows accumulated before a writer callback flush. |
id_check |
For source identifiers, |
parallel |
Execution mode: sequential, explicitly parallel, or automatic. |
workers |
Optional positive number of parallel workers. |
strategy |
Parallel scheduling strategy or |
chunk_records |
Optional number of complete XML records in an outer parallel chunk. |
task_records |
Optional number of records per inner parallel task. |
The streaming parser and record-boundary detection remain coordinator-side. Parallel workers receive only complete independent record subtrees.
Invisibly, a one-row tibble of streaming execution statistics augmented with
output_file and output_format. The main side effect is transactional
publication of the completed CSV at output.
xml_profile(), rectangle_xml()
Lower-level explicit parallel entry point retained for diagnostics, regression tests and advanced tuning. Routine use should normally use the corresponding ordinary function with the parallel argument.
rectangle_xml_parallel( file, spec, whitespace = NULL, workers = NULL, strategy = c("shared_chunk", "parallel_chunks"), chunk_records = NULL, task_records = NULL, progress = FALSE)rectangle_xml_parallel( file, spec, whitespace = NULL, workers = NULL, strategy = c("shared_chunk", "parallel_chunks"), chunk_records = NULL, task_records = NULL, progress = FALSE)
file |
Path to the XML file. |
spec |
A compiled rectangle specification or an |
whitespace |
Optional blank-text policy. |
workers |
Optional positive number of parallel workers. |
strategy |
Parallel scheduling strategy. |
chunk_records |
Optional number of complete records in an outer processing chunk. |
task_records |
Optional number of records per inner task. |
progress |
Logical; whether to emit progress events through progressr. |
A tibble containing the same rectangular analytical result and atomic-column structure
as rectangle_xml(), after reading the XML file and executing the compiled/profile
rectangle in parallel.
xml_profile(), rectangle_xml()
Apply an explicit profile/specification while preserving repeated values and output order. Parallelism is an execution option of the same public workflow.
rectangle_xml_parquet( file, spec, output_dir, overwrite = FALSE, compression = "snappy", document_id = NULL, whitespace = NULL, chunk_rows = 100000L, batch_rows = 100000L, id_check = c("memory", "none"), parallel = FALSE, workers = NULL, strategy = "auto", chunk_records = NULL, task_records = NULL)rectangle_xml_parquet( file, spec, output_dir, overwrite = FALSE, compression = "snappy", document_id = NULL, whitespace = NULL, chunk_rows = 100000L, batch_rows = 100000L, id_check = c("memory", "none"), parallel = FALSE, workers = NULL, strategy = "auto", chunk_records = NULL, task_records = NULL)
file |
Path to the XML file. |
spec |
A compiled rectangle specification. |
output_dir |
Destination directory for the Parquet dataset. |
overwrite |
Logical; whether an existing destination may be replaced. |
compression |
Parquet compression codec passed to arrow. |
document_id |
Optional identifier attached to canonical rows; by default it is derived from the input file. |
whitespace |
Optional blank-text policy; when omitted, the specification policy is used. |
chunk_rows |
Positive number controlling the canonical SAX node-buffer capacity. |
batch_rows |
Maximum number of rectangled rows accumulated before a writer flush. |
id_check |
For source identifiers, |
parallel |
Execution mode: sequential, explicitly parallel, or automatic. |
workers |
Optional positive number of parallel workers. |
strategy |
Parallel scheduling strategy or |
chunk_records |
Optional number of complete XML records in an outer parallel chunk. |
task_records |
Optional number of records per inner parallel task. |
The streaming parser and record-boundary detection remain coordinator-side. Parallel workers receive only complete independent record subtrees.
Invisibly, a one-row tibble of streaming execution statistics augmented with the published output directory, format, number of Parquet parts, and compression setting. The main side effect is transactional publication of the completed Parquet dataset.
xml_profile(), rectangle_xml()
Discover structural evidence and define a reviewable, reusable extraction contract. Proposals and XSD evidence are advisory rather than silently executable.
review_rectangle(spec)review_rectangle(spec)
spec |
A compiled rectangle specification returned by |
A tibble giving the atomic output-field mapping of an xml_rect_spec. It reports
each output name, source, declared type, value kind, owning entity, whether it lies
under repetition, and its observed maximum multiplicity per record.
xml_profile(), rectangle_xml()
Discover structural evidence and define a reviewable, reusable extraction contract. Proposals and XSD evidence are advisory rather than silently executable.
review_xml_proposal( proposal, what = c("rows", "ids", "fields", "xsd"))review_xml_proposal( proposal, what = c("rows", "ids", "fields", "xsd"))
proposal |
A proposal returned by |
what |
Which proposal component to review: row candidates, ID candidates, fields, or XSD evidence. |
A tibble containing the requested review section of an xml_profile_proposal.
Depending on what, it contains row candidates, identifier candidates, field
candidates, or XSD declarations, with internal matching keys removed from the
user-facing candidate tables.
xml_profile(), rectangle_xml()
Work with the canonical XML-node representation that preserves node identity, parentage, source order, namespaces, node types and scalar values.
validate_xml_nodes(nodes)validate_xml_nodes(nodes)
nodes |
A data frame intended to satisfy the canonical XML node-table contract. |
Invisibly returns TRUE when nodes satisfies the canonical node-table
invariants. The function otherwise stops with an error describing the violated
invariant.
xml_profile(), rectangle_xml()
Discover structural evidence and define a reviewable, reusable extraction contract. Proposals and XSD evidence are advisory rather than silently executable.
write_xml_profile( profile, file, format = c("auto", "json", "yaml"), overwrite = FALSE)write_xml_profile( profile, file, format = c("auto", "json", "yaml"), overwrite = FALSE)
profile |
An |
file |
Destination JSON or YAML file. |
format |
Serialization format. |
overwrite |
Logical; whether an existing destination may be replaced. |
Invisibly, a character scalar giving the normalized path of the JSON or YAML file that was written. Writing the serialized profile is the function's side effect.
xml_profile(), rectangle_xml()
Create or work with the exploratory single-table analyst projection, which keeps universal xml_* provenance/entity columns alongside atomic analytical values.
xml_analyst_expand_context(x, entity = NULL, levels = Inf)xml_analyst_expand_context(x, entity = NULL, levels = Inf)
x |
A table returned by |
entity |
Optional entity name or vector of entity names to retain. |
levels |
Maximum number of ancestor-entity levels from which contextual values may be propagated; |
A tibble with the same columns as x, optionally filtered by entity, in which
missing analytical cells are filled from owning fields of the requested ancestor levels.
Provenance/entity columns are retained so the expanded values remain traceable to the
analyst-table hierarchy.
xml_profile(), rectangle_xml()
Create or work with the exploratory single-table analyst projection, which keeps universal xml_* provenance/entity columns alongside atomic analytical values.
xml_analyst_table( nodes, infer_types = TRUE, include_misc = TRUE, .validate_nodes = TRUE)xml_analyst_table( nodes, infer_types = TRUE, include_misc = TRUE, .validate_nodes = TRUE)
nodes |
A canonical XML node table. |
infer_types |
Logical; whether conservative scalar type inference is applied to analyst data columns. |
include_misc |
Logical; whether miscellaneous XML content/provenance columns are retained. |
.validate_nodes |
Internal logical fast-path control. Ordinary callers should leave this at |
A tibble representing one self-contained analyst-oriented table. Each row is an XML
entity occurrence with xml_* provenance/entity columns plus atomic analytical
value columns; the table also carries an xml_analyst_metadata attribute
containing entity/path mappings, column sources, amplification diagnostics, and audit
information.
xml_profile(), rectangle_xml()
Work with the canonical XML-node representation that preserves node identity, parentage, source order, namespaces, node types and scalar values.
xml_node_children( nodes, node_id, document_id = NULL, include_attributes = FALSE)xml_node_children( nodes, node_id, document_id = NULL, include_attributes = FALSE)
nodes |
A canonical XML node table. |
node_id |
Positive canonical node identifier whose children are requested. |
document_id |
Optional document identifier used to disambiguate node IDs in combined tables. |
include_attributes |
Logical; whether attribute rows owned by the node are included with child content. |
A tibble containing the direct children of node_id, using the canonical
node-table columns. Rows are returned in XML content order, with attributes optionally
included ahead of content children.
xml_profile(), rectangle_xml()
Work with the canonical XML-node representation that preserves node identity, parentage, source order, namespaces, node types and scalar values.
xml_nodes_schema()xml_nodes_schema()
A zero-row tibble with the 12 canonical XML node-table columns and their stable atomic types. It is the executable schema used to initialize and validate canonical node output.
xml_profile(), rectangle_xml()
Discover structural evidence and define a reviewable, reusable extraction contract. Proposals and XSD evidence are advisory rather than silently executable.
xml_profile( rows, id = NULL, fields = NULL, types = NULL, namespace = NULL, layout = c("safe", "wide", "long"))xml_profile( rows, id = NULL, fields = NULL, types = NULL, namespace = NULL, layout = c("safe", "wide", "long"))
rows |
Visible XML element name or path defining one output record. |
id |
Optional visible value name/path used as record identifier; omit or use |
fields |
Optional character vector of values to retain. Named entries rename output columns. |
types |
Optional named character vector declaring output types. |
namespace |
Optional namespace URI used to disambiguate the row element. |
layout |
One-table layout policy: safe automatic layout, explicitly wide, or explicitly long. |
An object of class xml_profile, implemented as a named list containing the
portable user choices rows, id, fields, types,
namespace, and layout together with a profile version. It does not contain
sample-specific internal path keys.
xml_profile(), rectangle_xml()
Apply an explicit profile/specification while preserving repeated values and output order. Parallelism is an execution option of the same public workflow.
xml_rectangle( nodes, spec, parallel = FALSE, workers = NULL, strategy = "auto", chunk_records = NULL, task_records = NULL, progress = FALSE)xml_rectangle( nodes, spec, parallel = FALSE, workers = NULL, strategy = "auto", chunk_records = NULL, task_records = NULL, progress = FALSE)
nodes |
A canonical XML node table. |
spec |
A compiled rectangle specification or an |
parallel |
Execution mode: |
workers |
Optional positive number of parallel workers. |
strategy |
Parallel scheduling strategy or |
chunk_records |
Optional number of complete records in an outer processing chunk. |
task_records |
Optional number of records per inner parallel task. |
progress |
Logical; whether to emit progress events through progressr. |
Use parallel = FALSE for the exact sequential path, parallel = TRUE to request tuned parallel defaults, or parallel = "auto" to let the engine avoid parallel overhead on small in-memory workloads.
A tibble containing the rectangular analytical result defined by spec. The table
is always a single data frame with atomic columns; its exact columns and wide/long
structure are determined by the compiled specification while preserving record and
repetition semantics.
xml_profile(), rectangle_xml()
Lower-level explicit parallel entry point retained for diagnostics, regression tests and advanced tuning. Routine use should normally use the corresponding ordinary function with the parallel argument.
xml_rectangle_parallel( nodes, spec, workers = NULL, strategy = c("shared_chunk", "parallel_chunks"), chunk_records = NULL, task_records = NULL, progress = FALSE)xml_rectangle_parallel( nodes, spec, workers = NULL, strategy = c("shared_chunk", "parallel_chunks"), chunk_records = NULL, task_records = NULL, progress = FALSE)
nodes |
A canonical XML node table. |
spec |
A compiled rectangle specification or an |
workers |
Optional positive number of parallel workers. |
strategy |
Parallel scheduling strategy. |
chunk_records |
Optional number of complete records in an outer processing chunk. |
task_records |
Optional number of records per inner task. |
progress |
Logical; whether to emit progress events through progressr. |
A tibble containing the same rectangular analytical result and atomic-column structure
as xml_rectangle(), computed with explicit record-level parallel execution.
xml_profile(), rectangle_xml()
Work with the canonical XML-node representation that preserves node identity, parentage, source order, namespaces, node types and scalar values.
xml_stream_nodes( file, callback, document_id = NULL, whitespace = c("preserve", "drop_blank"), chunk_rows = 100000L)xml_stream_nodes( file, callback, document_id = NULL, whitespace = c("preserve", "drop_blank"), chunk_rows = 100000L)
file |
Path to the XML file. |
callback |
Function called with each emitted canonical node-table chunk. |
document_id |
Optional identifier attached to canonical rows; by default it is derived from the input file. |
whitespace |
How blank text nodes are handled. |
chunk_rows |
Positive maximum number of canonical rows buffered before the callback is invoked. |
Invisibly, a one-row tibble containing document_id, total node_count, and
emitted chunk_count. The main side effect is repeated invocation of
callback with bounded canonical node-table chunks.
xml_profile(), rectangle_xml()
Apply an explicit profile/specification while preserving repeated values and output order. Parallelism is an execution option of the same public workflow.
xml_stream_rectangle( file, spec, callback, document_id = NULL, whitespace = NULL, chunk_rows = 100000L, batch_rows = 100000L, id_check = c("memory", "none"), parallel = FALSE, workers = NULL, strategy = "auto", chunk_records = NULL, task_records = NULL)xml_stream_rectangle( file, spec, callback, document_id = NULL, whitespace = NULL, chunk_rows = 100000L, batch_rows = 100000L, id_check = c("memory", "none"), parallel = FALSE, workers = NULL, strategy = "auto", chunk_records = NULL, task_records = NULL)
file |
Path to the XML file. |
spec |
A compiled rectangle specification. |
callback |
Function called with each emitted rectangled result batch. |
document_id |
Optional identifier attached to canonical rows. |
whitespace |
Optional blank-text policy; when omitted, the specification policy is used. |
chunk_rows |
Positive number controlling the canonical SAX node-buffer capacity. |
batch_rows |
Maximum number of rectangled rows passed to a callback batch. |
id_check |
For source identifiers, |
parallel |
Execution mode: sequential, explicitly parallel, or automatic. |
workers |
Optional positive number of parallel workers. |
strategy |
Parallel scheduling strategy or |
chunk_records |
Optional number of complete XML records in an outer parallel chunk. |
task_records |
Optional number of records per inner parallel task. |
The streaming parser and record-boundary detection remain coordinator-side. Parallel workers receive only complete independent record subtrees.
Invisibly, a one-row tibble of streaming execution statistics, including document/node
counts, record count, emitted result rows and chunks, maximum record size, and
identifier-check status; parallel execution also reports scheduling statistics.
Rectangular result batches are delivered through callback as the main side
effect.
xml_profile(), rectangle_xml()
Lower-level explicit parallel entry point retained for diagnostics, regression tests and advanced tuning. Routine use should normally use the corresponding ordinary function with the parallel argument.
xml_stream_rectangle_parallel( file, spec, callback, document_id = NULL, whitespace = NULL, chunk_rows = 100000L, batch_rows = 100000L, id_check = c("memory", "none"), workers = NULL, strategy = c("shared_chunk", "parallel_chunks"), chunk_records = NULL, task_records = NULL)xml_stream_rectangle_parallel( file, spec, callback, document_id = NULL, whitespace = NULL, chunk_rows = 100000L, batch_rows = 100000L, id_check = c("memory", "none"), workers = NULL, strategy = c("shared_chunk", "parallel_chunks"), chunk_records = NULL, task_records = NULL)
file |
Path to the XML file. |
spec |
A compiled rectangle specification. |
callback |
Function called with each emitted rectangled result batch. |
document_id |
Optional identifier attached to canonical rows. |
whitespace |
Optional blank-text policy; when omitted, the specification policy is used. |
chunk_rows |
Positive number controlling the canonical SAX node-buffer capacity. |
batch_rows |
Maximum number of rectangled rows passed to a callback batch. |
id_check |
For source identifiers, |
workers |
Optional positive number of parallel workers. |
strategy |
Parallel scheduling strategy. |
chunk_records |
Optional number of complete XML records in an outer parallel chunk. |
task_records |
Optional number of records per inner parallel task. |
Invisibly, a one-row tibble of streaming and parallel execution statistics:
document/node counts, parser chunks, record and result counts, maximum record size,
identifier-check status, strategy, worker count, parallel chunk/task counts, buffering,
and chunk/task sizes. Rectangular result batches are delivered through callback
as the main side effect.
xml_profile(), rectangle_xml()
Work with the canonical XML-node representation that preserves node identity, parentage, source order, namespaces, node types and scalar values.
xml_text_to_nodes_memory( text, document_id = "inline-xml", whitespace = c("preserve", "drop_blank"), initial_capacity = 1024L)xml_text_to_nodes_memory( text, document_id = "inline-xml", whitespace = c("preserve", "drop_blank"), initial_capacity = 1024L)
text |
One character string containing XML markup. |
document_id |
Identifier assigned to all canonical rows from the supplied XML text. |
whitespace |
How blank text nodes are handled. |
initial_capacity |
Positive initial size of the internal row buffer; it grows automatically as needed. |
A tibble with one row per retained node in the supplied XML text and the 12 canonical node-table columns describing document identity, tree position, node type, names, namespace information, and scalar value.
xml_profile(), rectangle_xml()
Work with the canonical XML-node representation that preserves node identity, parentage, source order, namespaces, node types and scalar values.
xml_to_nodes_memory( file, document_id = NULL, whitespace = c("preserve", "drop_blank"), initial_capacity = 1024L)xml_to_nodes_memory( file, document_id = NULL, whitespace = c("preserve", "drop_blank"), initial_capacity = 1024L)
file |
Path to the XML file. |
document_id |
Optional identifier attached to all canonical rows; by default it is derived from the input file. |
whitespace |
How blank text nodes are handled. |
initial_capacity |
Positive initial size of the internal row buffer; it grows automatically as needed. |
A tibble with one row per retained XML node and the 12 canonical node-table columns describing document identity, tree position, node type, names, namespace information, and scalar value.
xml_profile(), rectangle_xml()
Work with the canonical XML-node representation that preserves node identity, parentage, source order, namespaces, node types and scalar values.
xml_to_nodes_stream( file, document_id = NULL, whitespace = c("preserve", "drop_blank"), chunk_rows = 100000L)xml_to_nodes_stream( file, document_id = NULL, whitespace = c("preserve", "drop_blank"), chunk_rows = 100000L)
file |
Path to the XML file. |
document_id |
Optional identifier attached to canonical rows; by default it is derived from the input file. |
whitespace |
How blank text nodes are handled. |
chunk_rows |
Positive maximum number of canonical rows buffered per emitted chunk. |
A complete canonical XML node-table tibble assembled from the streaming reader, with one
row per retained XML node and the same 12 columns and types as
xml_nodes_schema().
xml_profile(), rectangle_xml()