XML::Ha...uildDOM(3)

πŸ’– NAME πŸ’–

okay so this page is XML::Ha...uildDOM(3) from the User Contributed Perl Documentation, and it's all about XML::Handler::BuildDOM πŸ’…. The whole one-line summary is: it's a PerlSAX handler that creates XML::DOM document structures β€” main character energy for your XML tree, no cap ✨.


✨ SYNOPSIS ✨

use XML::Handler::BuildDOM;
use XML::Parser::PerlSAX;

my $handler = new XML::Handler::BuildDOM (KeepCDATA => 1);
my $parser = new XML::Parser::PerlSAX (Handler => $handler);

my $doc = $parser->parsefile ("file.xml");

πŸ¦‹ DESCRIPTION πŸ¦‹

XML::Handler::BuildDOM creates XML::DOM document structures β€” literally XML::DOM::Document objects β€” from PerlSAX events. It's giving "events in, document out" and honestly? iconic 🫢.

Also, name lore drop: this class used to be called XML::PerlSAX::DOM prior to libxml-enno 1.0.1 πŸŽ€.

πŸŽ€ CONSTRUCTOR OPTIONS πŸŽ€

The XML::Handler::BuildDOM constructor supports the following options, bestie:

  • KeepCDATA => 1 β€” if you set it to 0 (which is the default), CDATASections get converted into regular text. So default 0 means no CDATA special treatment, periodt.
  • Document => $doc β€” if it's undefined, start_document will extract it from Element or DocType (if set); otherwise it will create a new XML::DOM::Document.
  • Element => $elem β€” if it's undefined, it is set to Document. This is the insertion point (or parent) for the nodes defined by the following callbacks. Basically the spot where the new nodes get tucked in πŸ’….
  • DocType => $doctype β€” if it's undefined, start_document will extract it from Document (if possible). Otherwise it adds a new XML::DOM::DocumentType to the Document.

πŸ’– okay that's literally the whole page, bestie! source/version: perl v5.42.0 β€’ date: 2022-05-23 β€’ manual: XML::Ha...uildDOM(3) β€” bye bestie 🫢✨

πŸ“¦ where this page comes from