https://github.com/shred/commons-xml
Simple XML reader for Java
https://github.com/shred/commons-xml
java-library lightweight simple xml-parser-library
Last synced: 4 months ago
JSON representation
Simple XML reader for Java
- Host: GitHub
- URL: https://github.com/shred/commons-xml
- Owner: shred
- License: lgpl-3.0
- Created: 2014-10-19T21:22:31.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2019-01-27T15:13:27.000Z (almost 7 years ago)
- Last Synced: 2024-12-25T19:49:52.673Z (about 1 year ago)
- Topics: java-library, lightweight, simple, xml-parser-library
- Language: Java
- Homepage:
- Size: 45.9 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-LGPL.txt
Awesome Lists containing this project
README
# commons-xml  
A Java library for easy XML processing.
This software is part of the Shredzone Commons.
## Features
* Lightweight, very simple and comprehensible API
* No bells and whistles, no namespaces, no validation, just plain XML parsing
* Use XPath expressions for selecting the XML parts you want to read
* Use streaming API and lambda expressions to process the XML data
## Quick Start
A very simple use case is reading text from a configuration file. This is the XML file to be read:
```xml
Hello
World
```
This is the program code:
```java
XQuery xq = XQuery.parse(new FileReader("config.xml"));
String foo1 = xq.text("/config/foo1"); // Hello
String foo2 = xq.text("/config/foo2"); // World
```
That's all!
But _commons-xml_ offers a lot more possibilities. Just see the [online documentation](https://shredzone.org/maven/commons-xml/) for more examples.
## Contribute
* Fork the [Source code at Codeberg](https://codeberg.org/shred/commons-xml). Feel free to send pull requests.
* Found a bug? [File a bug report!](https://codeberg.org/shred/commons-xml/issues)
## License
_commons-xml_ is open source software. The source code is distributed under the terms of [GNU Lesser General Public License Version 3](http://www.gnu.org/licenses/lgpl-3.0.html).