{"id":19563130,"url":"https://github.com/fasterxml/aalto-xml","last_synced_at":"2025-05-14T03:10:54.677Z","repository":{"id":1049023,"uuid":"880546","full_name":"FasterXML/aalto-xml","owner":"FasterXML","description":"Ultra-high performance non-blocking XML processor (Stax API + extensions)","archived":false,"fork":false,"pushed_at":"2025-02-12T02:28:19.000Z","size":4827,"stargazers_count":295,"open_issues_count":19,"forks_count":73,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-10T20:55:10.323Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FasterXML.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"tidelift":"maven/com.fasterxml:aalto-xml","github":"cowtowncoder"}},"created_at":"2010-09-01T20:23:22.000Z","updated_at":"2025-03-21T06:32:55.000Z","dependencies_parsed_at":"2024-06-20T23:26:46.744Z","dependency_job_id":"378185f0-c473-41eb-9a84-8a020a26944e","html_url":"https://github.com/FasterXML/aalto-xml","commit_stats":{"total_commits":247,"total_committers":14,"mean_commits":"17.642857142857142","dds":0.4493927125506073,"last_synced_commit":"0820590fcf56ec3d5ca14608d6145e14e56f2650"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FasterXML%2Faalto-xml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FasterXML%2Faalto-xml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FasterXML%2Faalto-xml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FasterXML%2Faalto-xml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FasterXML","download_url":"https://codeload.github.com/FasterXML/aalto-xml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254059513,"owners_count":22007769,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T05:16:41.133Z","updated_at":"2025-05-14T03:10:49.661Z","avatar_url":"https://github.com/FasterXML.png","language":"Java","funding_links":["https://tidelift.com/funding/github/maven/com.fasterxml:aalto-xml","https://github.com/sponsors/cowtowncoder","https://tidelift.com/badges/package/maven/com.fasterxml:aalto-xml","https://tidelift.com/subscription/pkg/maven-com-fasterxml-aalto-xml?utm_source=maven-com-fasterxml-aalto-xml\u0026utm_medium=referral\u0026utm_campaign=readme","https://tidelift.com/security"],"categories":[],"sub_categories":[],"readme":"# Overview\n\nAalto XML processor is an ultra-high performance next generation Stax XML processor implementation, implementing both\nbasic Stax API (`javax.xml.stream`) and Stax2 API extension (`org.codehaus.woodstox.stax2`).\nIn addition, it also implements SAX2 API.\n\nIn additional to standard Java XML interfaces, one unique feature not implemented by any other Java XML parser\nthat we are aware is so-called non-blocking (asynchronous) XML parsing: ability to parse XML without using\nblocking I/O, necessary for fully asynchronous processing such as those with Akka framework.\nAalto non-blocking API is a minimalistic extension above Stax/Stax2 API to allow indication of \"not yet available\" token (EVENT_INCOMPLETE) as well as feeding of input (since InputStream can not be used as it blocks)\n\nAalto is licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt)\n\n## Status\n\n| Type | Status |\n| ---- | ------ |\n| Build (CI) | [![Build (github)](https://github.com/FasterXML/aalto-xml/actions/workflows/main.yml/badge.svg)](https://github.com/FasterXML/aalto-xml/actions/workflows/main.yml) |\n| Artifact |  [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.fasterxml/aalto-xml/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.fasterxml/aalto-xml/) |\n| OSS Sponsorship | [![Tidelift](https://tidelift.com/badges/package/maven/com.fasterxml:aalto-xml)](https://tidelift.com/subscription/pkg/maven-com-fasterxml-aalto-xml?utm_source=maven-com-fasterxml-aalto-xml\u0026utm_medium=referral\u0026utm_campaign=readme) |\n| Javadocs | [![Javadoc](https://javadoc.io/badge/com.fasterxml/aalto-xml.svg)](http://www.javadoc.io/doc/com.fasterxml/aalto-xml)\n| Code coverage (5.x) | [![codecov.io](https://codecov.io/github/FasterXML/aalto-xml/coverage.svg?branch=master)](https://codecov.io/github/FasterXML/aalto-xml?branch=master) |\n| OpenSSF Score | [![OpenSSF  Scorecard](https://api.securityscorecards.dev/projects/github.com/FasterXML/aalto-xml/badge)](https://securityscorecards.dev/viewer/?uri=github.com/FasterXML/aalto-xml) |\n\n## Support\n\nThere are 2 types of support available:\n\n* Community support via mailing lists: [aalto-xml-interest](aalto-xml-interest@yahoogroups.com)\n* Optional Commercial Support is available via [Tidelift Subscriptions](https://tidelift.com/subscription/pkg/maven-com-fasterxml-aalto-xml?utm_source=maven-com-fasterxml-aalto-xml\u0026utm_medium=referral\u0026utm_campaign=readme)\n\n## Contributing\n\nFor simple bug reports and fixes, and feature requests, please simply use projects\n[Issue Tracker](../../issues), with exception of security-related issues for which\nwe recommend filing a\n[Tidelift security contact](https://tidelift.com/security) (NOTE: you do NOT have to be\na subscriber to do this).\n\n## Documentation\n\n* [Project Wiki](https://github.com/FasterXML/aalto-xml/wiki) (docs, downloads)\n* [Aalto tutorial](https://www.studytrails.com/2016/09/12/java-xml-aalto-introduction/) (by [StudyTrails](http://www.studytrails.com))\n* Cowtown blog:\n    * [Non-blocking XML parsing with Aalto 0.9.7](http://www.cowtowncoder.com/blog/archives/2011/03/entry_451.html) (note: minor changes to API since then)\n\n## JDK Compatibility\n\nAalto 1.x:\n\n* Can be _used_ on JDK versions 6 (1.6) and up\n    * needs JDK 8 or higher to _build_ as of Aalto `1.2.0`\n* Contains Java 9 Module definition (`module-info.class`) starting with version `1.2.0`\n\n## Usage\n\n### Dependency\n\nAalto dependency is usually added via Maven repository, so something like:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.fasterxml\u003c/groupId\u003e\n    \u003cartifactId\u003eaalto-xml\u003c/artifactId\u003e\n    \u003cversion\u003e1.3.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Blocking XML parsing (Stax, SAX)\n\nBlocking XML parsing is done using one of standard interfaces:\n\n* Stax (javax.xml.stream) interface -- countless tutorials exist.\n    * Also implements [Stax2](../../../stax2-api)  extension\n    * [StaxMate](../../../StaxMate) is a good companion library for more convenient access\n\n### Non-blocking (\"async\") XML parsing\n\nNon-blocking parsing interface is extension of basic Stax (and Stax2) API, with extensions defined in 'com.fasterxml.aalto' package:\n\n* `AsyncXMLInputFactory` offers factory methods for creating non-blocking parsers\n* `AsyncXMLStreamReader` is extended type that non-blocking parsers implement\n    * `AsyncXMLStreamReader.EVENT_INCOMPLETE` (value 257; just outside range reserved by Stax API) is used to denote \"not yet available\" (without more data)\n    * Method `getInputFeeder()` is used to access object of type 'AsyncInputFeeder' used to feed input non-blocking way\n* `AsyncInputFeeder` contains methods for feeding input.\n\nTypical usage pattern is one where block of input is fed to parser, and zero or more complete events are read using basic 'XMLStreamReader.next()' method; and once 'EVENT_INCOMPLETE' is returned, more input needs to be given. AsyncXMLStreamReader itself does not buffer input beyond a single block; caller is responsible for additional buffering, if any.\nSee [Async parsing](Code-sample:-Async-parsing) for details.\n\nConstruction of `AsyncXMLInputFactory` is simple; instance may be constructed with or without initial content to parse:\n\n```java\nAsyncXMLInputFactory f = new InputFactoryImpl();\n// IF there is content use this:\nAsyncXMLStreamReader\u003cAsyncByteArrayFeeder\u003e parser = f.createAsyncFor(byteArray);\n// If NO CONTENT yet available, just use this:\nAsyncXMLStreamReader\u003cAsyncByteArrayFeeder\u003e parser = f.createAsyncForByteArray();\n```\n\nand more content is feed via `AsyncInputFeeder` when getting `EVENT_INCOMPLETE` via `parser.next()`:\n\n```java\nparser.getInputFeeder().feedInput(b, offset, dataLength);\n```\n\nor, if no more input available, indicate end-of-content with\n\n```java\nparser.getInputFeeder().endOfInput();\n```\n\nSee the [Full non-blocking parsing example](../../wiki/Code-sample:-Async-parsing) on Wiki for more details.\n\n### Aalto Design goals\n\n* Ultra-high performance parsing by making the Common Case Fast (similar to original RISC manifesto). This may mean limiting functionality, but never compromising correctness. XML 1.0 compliancy is not sacrificed for speed.\n* Allow non-block, asynchronous parsing: it should be possible to \"feed\" more input and incrementally get more XML events out, without forcing the current thread to block on I/O read operation. \n\n### Related\n\n* [Utility library based on Aalto](https://github.com/skjolber/async-stax-utils)\n* [Tool for obfuscating XML (uses Aalto for parsing)](https://github.com/adamretter/duplicitous)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffasterxml%2Faalto-xml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffasterxml%2Faalto-xml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffasterxml%2Faalto-xml/lists"}