The XML Library
Author: John Reppy
Keywords: Standard ML, SML, SML/NJ Library

The SML of NJ Library
The XML Library

## Overview

The XML Library is a small library for parsing XML files. It does not support validation (e.g., against a DTD or Schema). The basic idea is that the user supplies a "schema" module that describes the elements and attribute representation of an XML document. From this, one builds an XML tree representation

    structure MyXMLTree = XMLTreeFn (MyXMLSchema)

and an XML parser

    structure MyXMLParser = XMLParserFn (MyXMLTree)

The library also provides a generic XML tree definition (i.e., one that allows any element name).

For a more complete library for XML processing, use the fxp library.

## Contents

`signature XML_SCHEMA`

  describes the elements and attributes of an XML schema that are required to parse files of that schema.

`signature XML_TREE`

  Defines a tree representation of XML files.

`functor XMLTreeFn`

  Generates a tree representation of XML files from a schema structure argument.

`functor XMLParserFn`

  generates a parser for the given SML tree representation.

`structure GenericXMLTree`

  Provides a generic representation of XML trees.

## Usage

For SML/NJ, include `$/xml-lib.cm` in your CM file.

For use in MLton, include `$(SML_LIB)/smlnj-lib/XML/xml-lib.mlb` in your MLB file.

SML/NJ Version 110.99.9 (November 4, 2025)
Last updated 2025-11-04 15:48:25 UTC