An Erlang library for parsing and generating XML documents with SAX, simple DOM, and data binding modes.
Erlsom is an XML parser and generator for Erlang that provides multiple parsing modes to handle XML documents efficiently and flexibly. It solves the problem of processing XML in Erlang by offering SAX-based streaming for large documents, a simple DOM-like structure for easy access, and data binding with XSD schema validation for type-aware output. It is designed to integrate well with Erlang's concurrency model and functional programming paradigms.
Erlang developers working with XML data, particularly those needing to parse large or streaming XML documents, validate XML against schemas, or generate XML from Erlang data structures. It is also suitable for developers building systems like SOAP services, configuration file parsers, or data integration tools in Erlang.
Developers choose Erlsom over alternatives because it offers a unique combination of SAX streaming for memory-efficient parsing, direct binary support for performance, and data binding with XSD validation for structured output. Its flexibility in handling different parsing modes and seamless integration with Erlang's concurrency model makes it a versatile choice for XML processing in Erlang applications.
XML parser for Erlang
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers SAX for streaming, simple DOM for easy access, and data binder for schema-based validation, allowing developers to choose the right approach for their use case, as detailed in the README's examples.
SAX parser with chunked input supports processing XML documents that don't fit in memory, ideal for streaming or big data scenarios, demonstrated in the 'continuation' example.
Works directly on binaries (latin-1, utf-8, utf-16) without conversion to lists, optimizing memory and speed in Erlang 12B or later, as noted in the introduction.
Automatically detects and handles UTF-8, UTF-16, ISO-8859-1, and ISO-8859-15 encodings, simplifying internationalization without manual configuration.
Many XSD features like enumerations, patterns, fixed attributes, and key constraints are ignored, reducing validation rigor—the README explicitly lists these limitations in tables.
SAX parser does not support external entities and ignores DTDs, which can be a critical gap for XML standards that rely on these features.
Compiling XSDs creates new atoms, which in uncontrolled environments could lead to system crashes due to Erlang's atom table limits, as warned in the 'Creation of atoms' section.