---
warning: DO NOT CHANGE THIS MANUALLY, THIS IS GENERATED BY https://github.com/duckdb/community-extensions repository, check README there
title: webbed
excerpt: |
DuckDB Community Extensions
Comprehensive processing extension for web markup languages (XML and HTML) with SAX streaming for large files, intelligent schema inference, XPath-based data extraction, and HTML table parsing.
extension:
name: webbed
description: Comprehensive processing extension for web markup languages (XML and HTML) with SAX streaming for large files, intelligent schema inference, XPath-based data extraction, and HTML table parsing.
version: 2.14.0
language: C++
build: cmake
license: MIT
requires_toolchains: vcpkg
# Windows included since v2.4.0: DuckDB v1.5.4's vendored fmt no longer uses the removed
# MSVC STL API (the old compile blocker), and the extension builds and passes tests on the
# windows_amd64 MSVC runner in CI.
maintainers:
- teaguesterling
repo:
github: teaguesterling/duckdb_webbed
ref: 18c22232ebdb387014f4e024c5e41a2326358c88
# variegata: the v1.5.6 track. scripts/build.py:46-48 routes duckdb_version
# v1.5.6 here. Same commit as ref deliberately -- this release builds and
# passes on both lines, so v1.5.6 users get the correctness fixes rather than
# staying frozen at v2.10.0. The registry no longer builds v1.5 automatically;
# per the DuckDB team, a v1.5.6 build needs this field plus contacting them.
variegata: 18c22232ebdb387014f4e024c5e41a2326358c88
# ref_next is now DORMANT: build_next.yml is `if: false`, and build.py's
# ref_next branch is unreachable while the registry's duckdb_version equals its
# DUCKDB_LATEST_STABLE. Kept and moved with ref anyway -- it costs nothing and
# restores prerelease validation if that job is re-enabled. A STALE ref_next is
# worse than an absent one: it validates the PREVIOUS release while reporting
# green, so it must never lag ref.
ref_next: 18c22232ebdb387014f4e024c5e41a2326358c88
docs:
docs_url: https://duckdb-webbed.readthedocs.io
hello_world: |
-- Load the extension
LOAD webbed;
-- Read HTML files directly as structured document blocks
SELECT * FROM read_html_blocks('index.html');
-- Read XML files directly into tables
SELECT * FROM 'data.xml';
SELECT * FROM read_xml('config/*.xml');
-- Parse and extract from XML content using XPath
SELECT xml_extract_text('
| Name | Age |
|---|---|
| John | 25 |
');
-- Parse XML strings directly (without files)
SELECT * FROM parse_xml('Paragraph with bold text.
'); extended_description: | DuckDB XML is a comprehensive extension that brings powerful XML and HTML processing capabilities to DuckDB, enabling SQL-native analysis of structured documents. The extension provides four core areas of functionality: **XML Processing & Analysis**: Parse, validate, and extract data from XML documents using full XPath 1.0 expressions. Functions include `xml_extract_text()`, `xml_extract_elements()`, `xml_extract_attributes()`, `xml_valid()`, and `xml_stats()` for comprehensive document analysis. The extension handles namespaces with intelligent 'auto' mode detection, comments, CDATA sections, and provides utilities like `xml_pretty_print()` and `xml_minify()`. **HTML Processing & Web Scraping**: Advanced HTML parsing capabilities with specialized functions for web data extraction. Extract text content with `html_extract_text()`, parse HTML tables into structured data with `html_extract_tables()`, extract links with metadata using `html_extract_links()`, and extract images with attributes using `html_extract_images()`. Perfect for web scraping and HTML document analysis workflows. **Document Block Processing**: Convert HTML documents to and from structured block representations with `read_html_blocks()`, `parse_html_blocks()`, `html_to_duck_blocks()`, and `duck_blocks_to_html()`. Supports paragraphs, headings, code blocks, tables, lists, inline formatting (bold, italic, links, etc.), and frontmatter preservation. Integrates with the `duck_block_utils` extension for full Markdown support. **Smart Schema Inference & File Reading**: Automatically flatten XML/HTML documents into relational tables with intelligent type detection for dates, numbers, booleans, and nested structures. Functions like `read_xml()` and `read_html()` provide direct file-to-table conversion with configurable options including `datetime_format` presets, `nullstr` for custom NULL values, and schema customization. **SAX streaming** (v2.0) automatically handles files over 16MB using a push parser that processes XML in 64KB chunks — peak memory stays proportional to a single record, not the file size. Files compressed with gzip, or with zstd once `parquet` is loaded, are read directly. **Key XML Functions**: - `read_xml(pattern)` - Read XML files with automatic schema inference - `xml_extract_text(xml, xpath)` - XPath-based text extraction - `xml_extract_elements(xml, xpath)` - Extract structured elements - `xml_extract_attributes(xml, xpath)` - Extract attributes as structs - `xml_extract_text_each(xml, context_xpath, relative_xpath)` - One entry per context node, NULL where the relative path matches nothing, so parallel calls over sibling paths stay aligned for `unnest` - `xml_to_json(xml)` / `json_to_xml(json)` - Format conversions - `xml_stats(xml)` - Document statistics and analysis - `xml_validate_schema(xml, xsd)` - XSD schema validation - `xml_find_undefined_prefixes(xml, xpath)` - Detect undeclared namespace prefixes - `xml_add_namespace_declarations(xml, map)` - Inject namespace declarations - `parse_xml(content)` - Parse XML strings with schema inference - `parse_xml_objects(content)` - Parse XML strings to raw XML type **Key HTML Functions**: - `read_html(pattern)` - Read HTML files into tables - `read_html_blocks(pattern)` - Read HTML files directly into flattened `duck_block` rows - `parse_html_blocks(content)` - Parse HTML strings directly into flattened `duck_block` rows - `html_extract_tables(html)` - Extract HTML tables as structured data - `html_extract_links(html)` - Extract all links with metadata - `html_extract_images(html)` - Extract images with attributes - `html_extract_text(html, xpath)` - XPath-based HTML text extraction - `parse_html(content)` - Parse HTML strings with schema inference - `parse_html_objects(content)` - Parse HTML strings to raw HTML type - `html_to_duck_blocks(html)` - Convert HTML to structured document blocks - `duck_blocks_to_html(blocks)` - Convert document blocks back to HTML See https://duckdb-webbed.readthedocs.io for comprehensive documentation and examples. Built on libxml2 for robust, standards-compliant parsing with comprehensive error handling and memory-safe RAII implementation. 140 test files with 5017 assertions, including DOM/SAX equivalence, adversarial/security, and multi-file parallelism testing. The extension supports mixed file systems, configurable schema inference, and efficient processing of large document collections. extension_star_count: 78 extension_star_count_pretty: 78 extension_download_count: 26186 extension_download_count_pretty: 26.2k image: '/images/community_extensions/social_preview/preview_community_extension_webbed.png' layout: community_extension_doc --- ### Compatibility Matrix This table covers all DuckDB releases that have not reached [end-of-life](https://duckdb.org/release_calendar), including LTS releases, and shows the 2 most recent patch releases of each. Older patch releases are not listed, but the extension may be available for them as well. | Platform | 1.4.4 | 1.4.5 | 1.5.5 | 1.5.6 | 2.0.0 | | :--- | :---: | :---: | :---: | :---: | :---: | | Linux AMD64 | ✅ | ✅ | ✅ | ✅ | ✅ | | Linux ARM64 | ✅ | ✅ | ✅ | ✅ | ✅ | | macOS AMD64 | ✅ | ✅ | ✅ | ✅ | ✅ | | macOS ARM64 | ✅ | ✅ | ✅ | ✅ | ✅ | | Windows AMD64 | ✅ | ❌ | ✅ | ✅ | ✅ | | Windows ARM64 | ❌ | ❌ | ❌ | ❌ | ❌ | | WebAssembly | ✅ | ✅ | ✅ | ✅ | ✅ | ### Installing and Loading ```sql INSTALL {{ page.extension.name }} FROM community; LOAD {{ page.extension.name }}; ``` {% if page.docs.hello_world %} ### Example ```sql {{ page.docs.hello_world }}``` {% endif %} {% if page.docs.extended_description %} ### About {{ page.extension.name }} {{ page.docs.extended_description }} {% endif %} ### Added Functions | function_name | function_type | description | comment | examples | |--------------------------------|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | duck_blocks_to_html | scalar | Convert a list of duck_block structures back into an HTML document string. | NULL | [duck_blocks_to_html(html_to_duck_blocks('
')] |
| html_extract_links | scalar | Extract all hyperlink tags () from HTML as a list of structs. | NULL | [html_extract_links('DuckDB')] |
| html_extract_table_rows | scalar | Extract rows and cells from all tables in HTML as a list of structs. | NULL | [html_extract_table_rows('| A |
| A |
| H |
|---|
| V |
Text
'), html_to_duck_blocks('Paragraph
World
')] | | parse_html_objects | table | Parse an HTML string and return raw HTML object content. | NULL | [SELECT * FROM parse_html_objects('C1
B