bx-jsoup

Parse and sanitize HTML into BoxDocument objects with CSS selectors.

Updated Apr 10, 2026
One-click install
npx skills add https://github.com/ortus-boxlang/skills --skill bx-jsoup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bx-jsoup
Source: https://github.com/ortus-boxlang/skills/tree/main/boxlang-modules/bx-jsoup
Command: npx skills add https://github.com/ortus-boxlang/skills --skill bx-jsoup

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Parses and manipulates HTML content within BoxLang using the bx-jsoup module to enable safe rendering, extraction, and transformation.

Core Features & Use Cases

  • HTML parsing into BoxDocument objects (htmlParse).
  • CSS selector queries and element navigation (doc.select, getElementById, etc.).
  • HTML sanitization to prevent XSS (htmlClean with safelists).
  • JSON/XML conversion utilities (toJSON, toXML) for data interchange.
  • Use Case: ingest external HTML, sanitize it, extract links or text, and feed structured data downstream.

Quick Start

Create and parse a small HTML snippet, then sanitize and extract data in a single flow.

Frequently Asked Questions about bx-jsoup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I parse and sanitize HTML in BoxLang to prevent XSS?

Parse HTML in BoxLang using the htmlParse function to create BoxDocument objects, then apply htmlClean with safelists to sanitize content and prevent XSS vulnerabilities before downstream rendering or transformation.

What is the best way to extract specific elements from parsed HTML using CSS selectors?

After parsing HTML into a BoxDocument object with htmlParse, use doc.select with CSS selectors or getElementById to navigate the DOM tree and extract specific text, links, or attributes.

Can I convert parsed HTML content to JSON or XML for downstream processing?

Yes, the bx-jsoup module provides toJSON and toXML utilities that transform parsed BoxDocument objects into structured JSON or XML formats, enabling seamless downstream data interchange and integration.

Does the bx-jsoup module require any specific dependencies or runtime support?

The bx-jsoup module requires the BoxLang runtime environment with native support for htmlParse, htmlClean, toJSON, and toXML functions, but lists no additional external dependencies.

Why does HTML sanitization fail when processing external content in BoxLang?

HTML sanitization may fail if robust error handling and input validation are not properly implemented before calling htmlClean. Ensure external HTML input is validated and the BoxLang runtime supports the required safelist functions.