Metadata-Version: 2.1
Name: jinjanator-plugin-format-xml
Version: 23.2.0
Summary: Plugin which provides XML format (data input) support for Jinjanator
Project-URL: Bug Tracker, https://github.com/kpfleming/jinjanator-plugin-format-xml/issues
Project-URL: Homepage, https://github.com/kpfleming/jinjanator-plugin-format-xml
Author-email: "Kevin P. Fleming" <jinjanator@kevin.km6g.us>
License: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Python: >=3.8
Requires-Dist: jinjanator-plugins==23.4.*
Requires-Dist: xmltodict
Description-Content-Type: text/markdown

# *jinjanator-plugin-format-xml*: Provides XML format (data input) support for Jinjanator



This plugin allows Jinjanator to parse XML data for processing in
templates. The format can be selected using `--format xml` or
autoselected by using a data file with a name ending with `.xml`.

## Installation

```
pip install jinjanator-plugin-format-xml
```

## Usage

Suppose you have an NGINX configuration file template, `nginx.j2`:

```jinja2
server {
  listen 80;
  server_name {{ nginx.hostname }};

  root {{ nginx.webroot }};
  index index.htm;
}
```

And you have an XML file with the data, `nginx.xml`:

```xml
<nginx>
  <hostname>
    localhost
  </hostname>
  <webroot>
    /var/www/project
  </webroot>
</nginx>
```

This is how you render it into a working configuration file:

```bash
$ jinjanate nginx.j2 nginx.xml > nginx.conf
```

## Options

* `process-namespaces`: configures the XML parser to replace namespace
  references in element names with the corresponding namespaces from
  `xmlns` attributes in the top-level element in the document.
## Release Information
### Additions

- Added Python 3.12 support.
  [[#2](https://github.com/kpfleming/jinjanator-plugin-format-xml/issues/2)](https://github.com/kpfleming/jinjanator-plugin-format-xml/issues/2)


---
[→ Full Changelog](https://github.com/kpfleming/jinjanator-plugin-format-xml/blob/main/CHANGELOG.md)
