XML::Element(3pm)

πŸ“¦
version 5.4 Β· 6 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ NAME ✨

okay so bestie, welcome to XML::Element β€” it's the User Contributed Perl Documentation page and it's literally the whole vibe. what is it? XML elements with the exact same interface as HTML::Element. same energy, different tag. πŸŽ€


🌸 SYNOPSIS 🌸

  [See HTML::Element]

that's it. that's the synopsis. it's giving "go read the other page, i'm just the remix." πŸ’…


πŸ¦‹ METHODS AND ATTRIBUTES πŸ¦‹

delete_ignorable_whitespace

TODO: test and document this β€” and the way that it does that thing where, with no tagname set, it assumes ALL all-whitespace nodes are ignorable! 😭 like, bold assumption, but okay bestie, live your truth.

endtag

Redirects to endtag_XML. simple. iconic. no notes. ✨

starttag

Redirects to starttag_XML. same deal, cuter twin. πŸ’–

as_XML

  $s = $doc->as_XML()

Returns a string representing in XML the element and its descendants. so like, your whole lil XML family tree as one string. obsessed. 🌈

starttag_XML

  $start = $doc->starttag_XML();

Returns a string representing the complete start tag for the element. Except for CDATA. (yes that exception is real, don't come for me) 🫢

endtag_XML

  $end = $doc->endtag_XML();

Returns a string representing the complete end tag for this element. I.e., "</", tag name, and ">". Except for CDATA. same exception, same drama. πŸ’œ


πŸ‘‘ DESCRIPTION πŸ‘‘

so this is just a subclass of HTML::Element. it works basically the same as HTML::Element, EXCEPT β€” and this is the main character moment β€” tagnames and attribute names aren't forced to lowercase, like they are in HTML::Element. no lowercase jumpscare here, bestie. πŸ”₯

HTML::Element describes everything you can do with this class. so yeah, the lore lives over there. πŸ“š


πŸ’€ CAVEATS πŸ’€

Has currently no handling of namespaces. that's it, that's the caveat. fr fr. no cap. 🫠


🌟 SEE ALSO 🌟

  • XML::TreeBuilder β€” for a class that actually builds XML::Element structures. like, the builder bestie. 🧚
  • HTML::Element β€” for all documentation. the whole syllabus tbh. πŸ“–
  • XML::DOM and XML::Twig β€” for other XML document tree interfaces. options, we love options. 🌸
  • XML::Generator β€” for more fun. yes queen, more fun. πŸŽ‰

Copyright (c) 2000,2004 Sean M. Burke. All rights reserved. Copyright (c) 2010,2011,2013 Jeff Fearn. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. (translation: it's free, it's helpful, it's not promising you anything. standard.) 😌


🌈 AUTHOR 🌈

Current Author: Jeff Fearn <jfearn@cpan.org>.

Former Authors: Sean M. Burke, <sburke@cpan.org>


okay and for the lil sign-off moment β€” this page is from perl v5.34.0, dated 2022-06-28, and that's XML::Element(3pm) out. slay, go read HTML::Element, mwah πŸ’…βœ¨

πŸ“¦ where this page comes from