xmlightning
xmlightning is a simple, Flask-like way of creating XML parsers
Installation
Getting Started
For a basic hello world, take the following two files
Breakdown
After the Lightning class gets imported in your project, to use it you must instantiate it.
After the Lightning class was instantiated, the example uses the decorator, "route".
Route Decorator
The route decorator takes in one argument, path, which is a string.
Path refers to any valid XPATH string.
Note that the route decorator requires the function it is used on to take in one argument: element.
The type of element can be imported through the following
Next, the hello_world.xml file is parsed.
Whenever the parser encounters a path that matches a route, the function of that route is executed.
Finally, the string from the function is printed to the screen
hello_world