xmlt
Version, currently 0.2.02 versions
- 0.3.0latestSep 12, 2022
- 0.2.0not indexedApr 19, 2024
github.com/devnote-dev/xmlt
A library for serializing and deserializing XML documents with classes and structs.
8 stars
0 dependents
License: MIT
Nothing has been indexed for 0.2.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
xmlt:
github: devnote-dev/xmlt
version: ~> 0.2.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.2.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
# XML Transformer
A library for serializing and deserializing XML documents with classes and structs. This follows the same includable syntax used in the standard library's JSON and YAML modules.
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
xmlt:
github: devnote-dev/xmlt
```
2. Run `shards install`
## Basic Usage
```crystal
require "xmlt"
xml_str = %(<Numbers><one>1</one><two>2</two><three>3</three></Numbers>)
hash = Hash(String, Int32).from_xml xml_str, root: "Numbers"
puts hash # => {"one" => 1, "two" => 2, "three" => 3}
puts hash.to_xml # => <one>1</one><two>2</two><three>3</three>
```
## Structured Usage
```crystal
require "xmlt"
class Animal
# include the module so we can (de)serialize it
include XMLT::Serializable
property name : String
@[XMT::Field(key: "species")]
property kind : String
@[XMLT::Field(omit_nil: true)]
property family : String?
def initialize(@name, @kind, @family = nil)
end
end
fox = Animal.new "fox", "mammal"
fox.to_xml # => <Animal><species>mammal</species></Animal>
fox.family = "dog"
fox.to_xml # => <Animal><species>mammal</species><family>dog</family></Animal>
```
## Contributing
1. Fork it (<https://github.com/devnote-dev/xmlt/fork>)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
## Contributors
- [Devonte](https://github.com/devnote-dev) - creator and maintainer
This repository is managed under the MIT license.
© 2022 devnote-dev
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.2.0- Tagged
- Apr 19, 2024
- Commit
084174aa7ef6- Indexed
- not yet
Dependents
No indexed shard depends on this one yet.
Repository
github.com/devnote-dev/xmlt
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 13, 2026
- Versions
- 2