# Read an XML or HTML file

Acquire / file

read XML, HTML tables

Page: <https://meridian.online/operations/read-an-xml-or-html-file>

## Status

Runs as a SQL step.

arcform carries it as a `sql:` step today, with the `webbed` extension.

## The DuckDB step

parse XML into rows

```sql
INSTALL webbed FROM community; LOAD webbed;
COPY (SELECT '<rows><r><id>1</id><v>a</v></r><r><id>2</id><v>b</v></r></rows>' AS x) TO '<your_scratch_dir>/t.xml' (FORMAT csv, HEADER false, QUOTE '');
CREATE TEMP TABLE result AS
SELECT * FROM read_xml('<your_scratch_dir>/t.xml');
SELECT * FROM result;
SELECT CASE WHEN ((SELECT count(*) = 2 AND list(v ORDER BY id) = ['a', 'b'] FROM result)) THEN 'as expected' ELSE error('the two elements did not become two rows') END AS verdict;
```

Replace `<your_scratch_dir>` with a directory of your own that you can write to before running the statement.

The statement writes `t.xml` itself, in `<your_scratch_dir>`.

It needs the `webbed` extension.

## Variants

- [Read tables from an HTML page](https://meridian.online/operations/read-an-xml-or-html-file/read-tables-from-an-html-page): Pull the tables, or elements picked by CSS selector, out of an HTML page as rows.
- Stream a very large XML file: Read an XML file too large to hold in memory as a stream of element events.
- Read rows from an XML file: Turn the elements of an XML document into rows and columns, picking rows and fields by path.

## What other tools call it

Meridian's classification; an independent blind rating agreed on 86.2% of 312 rows (exact class, version 2).

- Azure Data Factory: [`XML format (source)`](https://learn.microsoft.com/en-us/azure/data-factory/format-xml) (read 2026-09-27)
- Duckle: [`HTML`](https://github.com/slothflowlabs/duckle/blob/f85f8960edfb6efbf4cb89d58a7b32e16df0e867/frontend/src/workflow-ui/palette-data.ts) (read 2026-09-25)
- Duckle: [`XML`](https://github.com/slothflowlabs/duckle/blob/f85f8960edfb6efbf4cb89d58a7b32e16df0e867/website/docs/components.html) (read 2026-09-25)
- EasyMorph: [`Import XML file`](https://help.easymorph.com/doku.php?id=transformations:importxml) (read 2026-09-27)
- AWS Glue: [`XML (read)`](https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-format-xml-home.html) (read 2026-09-27)
- Apache Hop: [`Get Data From XML`](https://hop.apache.org/manual/latest/pipeline/transforms/getdatafromxml.html) (read 2026-09-27)
- Apache Hop: [`XML Input Stream (StAX)`](https://hop.apache.org/manual/latest/pipeline/transforms/xmlinputstream.html) (read 2026-09-27)
- KNIME Analytics Platform: [`XML Reader`](https://api.hub.knime.com/nodes/*DEKq6D4DvpUUhyLz?details=full) (read 2026-09-27)
- Apache NiFi: [`WindowsEventLogReader`](https://nifi.apache.org/components/org.apache.nifi.windowsevent.WindowsEventLogReader/) (read 2026-09-27)
- Apache NiFi: [`XMLReader`](https://nifi.apache.org/components/org.apache.nifi.xml.XMLReader/) (read 2026-09-27)
- OpenRefine: [`XML`](https://openrefine.org/docs/manual/starting#create-a-project-by-importing-data) (read 2026-09-27)
- Pentaho Data Integration: [`Get data from XML`](https://docs.pentaho.com/pdia-data-integration/9.3-data-integration/pdi-transformation-steps-reference-overview) (read 2026-09-27)
- Pentaho Data Integration: [`XML Input Stream (StAX)`](https://docs.pentaho.com/pdia-data-integration/9.3-data-integration/pdi-transformation-steps-reference-overview) (read 2026-09-27)
- Power Query M: [`Html.Table`](https://learn.microsoft.com/en-us/powerquery-m/accessing-data-functions) (read 2026-09-27)
- Power Query M: [`Web.Page`](https://learn.microsoft.com/en-us/powerquery-m/accessing-data-functions) (read 2026-09-27)
- Power Query M: [`Xml.Document`](https://learn.microsoft.com/en-us/powerquery-m/accessing-data-functions) (read 2026-09-27)
- Power Query M: [`Xml.Tables`](https://learn.microsoft.com/en-us/powerquery-m/accessing-data-functions) (read 2026-09-27)
- RapidMiner Studio: [`Read XML`](https://docs.rapidminer.com/latest/studio/operators/data_access/files/read/read_xml.html) (read 2026-09-27)
- RapidMiner Studio: [`Read XRFF`](https://docs.rapidminer.com/latest/studio/operators/data_access/files/read/read_xrff.html) (read 2026-09-27)
- Talend: [`tFileInputMSXML`](https://help.qlik.com/talend/en-US/components/8.0/ms-xml-connectors/ms-xml-connectors-component) (read 2026-09-27)
- Talend: [`tFileInputXML`](https://help.qlik.com/talend/en-US/components/8.0/xml-connectors/xml-connectors-component) (read 2026-09-27)
- Talend: [`tFileStreamInputXML`](https://help.qlik.com/talend/en-US/components/8.0/xml/xml-component) (read 2026-09-27)
- VisiData: [`html (loader)`](https://github.com/saulpw/visidata/blob/7609212ec2febafa9caba7183cbebfaf49627909/visidata/loaders/html.py#L25) (read 2026-09-23)
- VisiData: [`xml (loader)`](https://github.com/saulpw/visidata/blob/7609212ec2febafa9caba7183cbebfaf49627909/visidata/loaders/xml.py#L9) (read 2026-09-23)
