Template::XML(3pm)
π¦ Template::XML β XML plugins for the Template Toolkit π¦
okay bestie, so this is Template::XML, and it lives in the User Contributed Perl Documentation section of the manual (that's the 3pm part, iykyk). it's giving "i have a whole little ecosystem of XML plugins and i'm gonna tell you about every single one." π
β¨ SYNOPSIS β¨
[% USE XML;
dom = XML.dom('foo.xml');
xpath = XML.xpath('bar.xml');
simple = XML.simple('baz.xml');
rss = XML.simple('news.rdf');
%]
look at that. five lines and you're already doing the most. π«Ά
πΈ DESCRIPTION πΈ
so the Template-XML distribution ships a whole lil' friend group of Template Toolkit plugin modules for working with XML. no cap.
Template::Plugin::XML is the front-end β the main character, honestly π β that hooks you up with all the other XML plugin modules. through it you can access XML files, and even whole directories of XML files, via Template::Plugin::XML::File and Template::Plugin::XML::Directory (and bestie, those two subclass from Template::Plugin::File and Template::Plugin::Directory respectively, just so you know the family tree).
and then, once you've got your hands on some XML, you can:
- build a Document Object Model (DOM) out of an XML file with
Template::Plugin::XML::DOM - poke around inside it using XPath queries with
Template::Plugin::XML::XPath - turn it into a plain ol' Perl data structure with
Template::Plugin::XML::Simple - or just parse it as an RSS (RDF Site Summary) file. slay.
π history lesson time, because it's actually kind of iconic: the basic XML plugins used to be bundled inside the Template Toolkit itself, all the way up until version 2.15, which dropped in May 2006. at that point they got extracted out into this separate Template-XML distribution, and an alpha version of this very Template::Plugin::XML front-end module got added to the mix. glow-up era. β¨
π AUTHORS π
give it up for the whole squad, fr fr:
- Andy Wardley wrote the Template Toolkit plugin modules β with assistance from Simon Matthews in the case of the
XML::DOMplugin. π«Ά - Matt Sergeant</c> wrote the
XML::XPathmodule. - Enno Derksen and Clark Cooper wrote the
XML::DOMmodule. - Jonathan Eisenzopf wrote the
XML::RSSmodule. - Grant McLean wrote the
XML::Simplemodule. - Clark Cooper and Larry Wall wrote the
XML::Parsermodule. - James Clark wrote the expat library. π₯
π COPYRIGHT π
Copyright (C) 1996-2006 Andy Wardley. All Rights Reserved.
this module is free software, bestie β you can redistribute it and/or modify it under the same terms as Perl itself. so go off. π
π SEE ALSO π
the whole extended universe, go read them all:
TemplateTemplate::PluginsTemplate::Plugin::XMLTemplate::Plugin::XML::DOMTemplate::Plugin::XML::RSSTemplate::Plugin::XML::SimpleTemplate::Plugin::XML::XPath
and that's the page, babe π¦ this one was perl v5.34.0 flavored and dated 2022-07-04 β so if your install says otherwise, don't come for me, that's just what the footer said. mwah. πβ¨
π¦ where this page comes from
- debian bookworm: libtemplate-plugin-xml-perl 2.17-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtemplate-plugin-xml-perl 2.17-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtemplate-plugin-xml-perl 2.17-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtemplate-plugin-xml-perl 2.17-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtemplate-plugin-xml-perl 2.17-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms