Skip to main content

Markup format

Keep verbose service documents navigable.

The XML parser in @loaders.gl/documents turns XML and supported HTML input into object trees that protocol-specific loaders can validate and normalize. It stays intentionally general so WMS, KML, GPX, and other consumers can define their own schemas.

Markup data path

Parse the tree here. Interpret the protocol next.

XMLLoader handles syntax and tree construction; higher-level modules decide what the elements mean. That separation keeps the general parser small and lets service loaders expose typed contracts.

Input

XML documents and supported HTML markup.

Parse

Construct a free-form JavaScript object tree.

Normalize

Let KML, WMS, GPX, or other modules apply protocol semantics.

Use

Inspect metadata or pass a typed result to application code.

Detailed guide

XML format and API details

The reference below covers accepted markup, object-tree conventions, HTML compatibility, and the parser entry points.

CharacteristicValue
File FormatXML, HTML
Data FormatFree-form JavaScript object tree
File Extensions.xml, .html, .htm
MIME Typesapplication/xml, text/xml, text/html
File TypeText
Loader APIsload, parse, parseTextSync
Loader Worker Thread❌ No
Loader Streaming❌ No

Loaders​

Markup​

XML and HTML are text markup formats. loaders.gl converts elements, attributes, and text content into JavaScript object structures for application-level processing.

HTML​

HTMLLoader is intentionally limited. It is useful for extracting small pieces of information from simple HTML responses, not for browser-grade HTML parsing or rendering.