Skip to content

Commit

Permalink
refactor: Add basic error handling, properly document code, refactor …
Browse files Browse the repository at this point in the history
…converters, remove useless checks. (#6)
  • Loading branch information
elenakrittik authored Sep 22, 2023
1 parent ff90378 commit 648e539
Show file tree
Hide file tree
Showing 5 changed files with 300 additions and 250 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2023-present ItsAleph
Copyright 2023-present elenakrittik

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
33 changes: 26 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,32 @@ This addon adds support for manipulating XML data in Godot 4 with ease.

## Features

- Pure-Godot - everything is done using built-in `XMLParser` and does not rely on external bindings*;
- Loading and dumping XML data into/from a convenient class-based format;
- Beautifying XML;
- Converting XML into dictionaries.
- Converting XML into dictionaries;
- Access uniquely named children of nodes as if they were regular attributes (works in the editor too!);
- Decent error messages for when the input is malformed*.

<details>
<summary>*Future plans</summary>

`XMLParser`, Godot's native, low-level XML parser that this addon works on top of, or, more specifically,
`irrXML` (on which `XMLParser` is based), always assumes input to be trusted and valid, and therefore lacks both
adequate error handling and adequate security measures. In case of error handling addon currently
implements a few workarounds that eliminate *known* godot bugs, but still cannot handle syntactically invalid
input; in case of security we can't do anything unfortunately. Due to the above and our intention for this
plugin to be usable in as much cases as possible, this addon will soon migrate to a custom, more modern XML
library like Expat.

Related issues on Godot's tracker:
- https://github.com/godotengine/godot/issues/72517
- https://github.com/godotengine/godot/issues/51380
- https://github.com/godotengine/godot/issues/81896
- https://github.com/godotengine/godot/issues/51622
- https://github.com/godotengine/godot/issues/81896#issuecomment-1731320027

</details>

## Installation

Expand All @@ -17,13 +40,9 @@ Search for the "GodotXML" addon on the asset library ([link](https://godotengine
All functions and attributes that are meant for use by you do not have `_` before their name
and are also listed before any internal function.

All other functions and attributes are **not meant** to be used by you, though you
can edit them as you like thanks to the license.
All other functions and attributes are **not meant** to be used by you, though of course
you can edit them as you like.

## Roadmap

- [ ] Allow dotted access for XMLNode's children;

- [ ] Automatic detection and conversion of nodes' content type;

- [ ] Setup automated tests.
Loading

0 comments on commit 648e539

Please sign in to comment.