xml.cr

Native XML for the Crystal language

XML

An exploratory shard to handle XML (and later HTML) in pure Crystal.

XML::SAX (parser)

The foundation parser is a Simple API for XML parser, aka SAX. It's inspired by The Expat XML parser API document (not its code) with adjustements for an Object Oriented languages, like a distinct XML::SAX::Handlers class for example.

The choice for a SAX parser is because of its relative simplicity along with its extensible flexibility. The parser deals with the syntax, which you shouldn't care about, while the handlers let you build whatever you need, and discard the rest. You may generate a full blown DOM tree, decide to recover from errors, or validate the XML document, or stream a XML document while skipping over anything you don't care about.

So far, the non validating DOM parser is 95% conpliant with the XML Conformance Test Suites.

References:

XML::DOM

The initial draft for a DOM in Crystal. Follows the DOM spec, adapted for crystal (snake_case instead of lowerCamelCase names), but keeps the clunky namings. We might consider normalizing the API to be much less verbose (maybe).

References:

XPATH 1.0

... TODO ...

References:

LICENSE

Distributed under the Apache-2.0 LICENSE.

AUTHOR

Julien PORTALIER

Repository

xml.cr

Owner
Statistic
  • 5
  • 0
  • 4
  • 0
  • 1
  • 3 months ago
  • November 12, 2024
License

Links
Synced at

Sun, 07 Dec 2025 18:56:40 GMT

Languages