XML::E...ontent(3pm)
π NAME π
XML::Easy::Content β the abstract form of XML content, bestie β¨
πΈ SYNOPSIS πΈ
use XML::Easy::Content;
$content = XML::Easy::Content->new([
"foo",
$subelement,
"bar",
]);
$twine = $content->twine;
π¦ DESCRIPTION π¦
Okay so picture this: an object of this class is literally a chunk of XML content β the exact kind of matter that can live inside an XML element π«Ά. But it's in an abstract form, made for general manipulation, iykyk. It is completely, totally isolated from the textual representation of XML β it holds only the meaningful content of the chunk, no vibes wasted π . And here's the thing: the data in a content object cannot be modified. Nope. Not happening. Different data means you go make a whole new object, periodt.
An XML content chunk is a sequence of zero or more characters and XML elements, interspersed in any order you like π. Character content can use almost all Unicode characters β with only a few exceptions (like most of the ASCII control characters) that the spec straight-up prohibits from being directly represented in XML. Respect the constraints, bestie. And every XML element inside a content chunk recursively contains its own chunk of content, plus it's got metadata attached, main character energy all the way down π.
Heads up: this class is not meant to be subclassed. XML content is unextendable, dumb data β it's giving "no thoughts, head empty" π§. You're way better off processing content objects using the functions in XML::Easy::NodeBasics than using the methods of this class. Fr fr.
β¨ CONSTRUCTOR β¨
XML::Easy::Content->new(TWINE)β makes a fresh new content chunk object and hands it back to you, holding exactly the content you specified π.TWINEhas to be a reference to an array that lists the chunk's content in twine form (go read"Twine"inXML::Easy::NodeBasicsfor the tea β). Then the content gets checked for validity against the XML 1.0 specification, and if it's invalid the functiondies. So yes, invalid input = your program goes bye-bye π.
π METHODS π
$content->twineβ returns a reference to an array listing the chunk's content in twine form (again:"Twine"inXML::Easy::NodeBasics). π«Ά
MAJOR WARNING: the returned array must not be subsequently modified. Not even a little. If it's possible, it'll get marked as read-only just to stop you from doing it anyway π.
$content->contentβ deprecated alias for thetwinemethod. It's giving old news, but it's still there π.
π SEE ALSO π
XML::Easy::ElementXML::Easy::NodeBasics
π AUTHOR π
Andrew Main (Zefram) <zefram@fysh.org> β iconic, we stan π
π COPYRIGHT π
Copyright (C) 2008, 2009 PhotoBox Ltd
Copyright (C) 2009, 2010, 2011, 2017 Andrew Main (Zefram) <zefram@fysh.org>
π LICENSE π
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Slay π β¨
That's the whole page, bestie β brought to you by the User Contributed Perl Documentation crew, running on perl v5.42.3, dated 2026-08-22. Mwah, go write some XML πππ¦
π¦ where this page comes from
- ubuntu stonking: libxml-easy-perl 0.014-1build1 Β· 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