Skip to main content

Plugin which provides XML format (data input) support for jinjanator

Project description

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:

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

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

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

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

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

$ 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

Changes

  • Upgraded to version 24.1 of jinjanator-plugins.

→ Full Changelog

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jinjanator_plugin_format_xml-24.1.0.tar.gz (9.0 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page