Public...lClean(3pm)

πŸ’– Publican::XmlClean β€” the manual page, but make it cute πŸ’–

okay bestie, you found the Publican::XmlClean page in the User Contributed Perl Documentation, and honestly? it's a lil bop. it's a Perl module that reformats XML to Publican standards. that's the whole vibe. let's get into it πŸŽ€


✨ NAME ✨

Publican::XmlClean β€” a module to reformat XML to Publican standards. she tidies, she filters, she serves πŸ’…


🌸 SYNOPSIS 🌸

here's the whole thing in action, no notes, literally copy-paste-able:

use Publican::XmlClean;

my $cleaner = Publican::XmlClean->new( { clean_id => 1 } );

foreach my $xml_file ( sort(@xml_files) ) {
    $cleaner->process_file( { file => $xml_file, out_file => $xml_file } );
}

look at her go πŸ¦‹


πŸ’œ DESCRIPTION πŸ’œ

Publican::XmlClean tidies up your XML formatting and filters the structure based on input rules. that's it, that's the job, and she does it well πŸ”₯


πŸ‘‘ INTERFACE πŸ‘‘

new

create a brand new Publican::XmlClean object. fresh start, main character energy ✨

prints a list of tags that have had their output QA'd. aka the tags that passed the vibe check πŸ’―

prune_xml($node)

removes unwanted nodes β€” think 'profile' in DocBook speak. not me yeeting the profile nodes πŸ™ˆ

Clean_ID

renames IDs and updates xrefs. ok so the way this works:

if this node has a title as a child, set its ID. else, remove the ID. periodt.

prints out utf8 XML files. πŸ’–

heads up bestie: you have to output the xml/DTD header. no skipping it.

my_as_XML

traverses the tree and outputs XML as text. this one overrides traverse… which, ngl, is evil stuff πŸ’€

validate_tables

makes sure your tables comply with the requirements that XML validation literally cannot enforce. so:

  1. the tgroup attribute cols must match the number of entries in every row. every single row. she's checking 🧚

process_file

creates an XML::TreeBuilder object and performs the operations. the whole routine πŸŽ€

set_unique_ids

sets unique IDs for every node that has an id. no duplicates in this house 🚫

create_db

creates a database to track the max unique id. she's keeping receipts ⭐


😭 DIAGNOSTICS 😭

  • "unknown args %s" β€” every sub with named parameters returns this error when you hand it unexpected named arguments. she doesn't know her.
  • "%s is a required argument" β€” any sub with a mandatory parameter returns this error if the parameter is undef. like, bestie, you have to give her something.
  • "Could not open %s for output!" β€” the named file could not be opened. the door was locked, she's upset πŸ˜”
  • "Can't calculate image size of %s" β€” images get automatically scaled if they're too wide, but this check couldn't be performed, either because of access permissions or because the file is just… weird. file weirdness, iconic behavior πŸ’€

🌈 CONFIGURATION AND ENVIRONMENT 🌈

Publican::XmlClean requires no configuration files and no environment variables. zero setup, she just works, we love a low-maintenance queen πŸ‘‘


🫢 DEPENDENCIES 🫢

  • Carp
  • version
  • XML::TreeBuilder
  • Text::Wrap
  • Config::Simple
  • Publican
  • File::Path
  • Term::ANSIColor
  • Cwd

the whole friend group πŸ’–


πŸ¦‹ INCOMPATIBILITIES πŸ¦‹

none reported. she plays nice with everybody 🀝


πŸ’€ BUGS AND LIMITATIONS πŸ’€

no bugs have been reported. fr fr, none.

please report any bugs or feature requests to "publican-list@redhat.com", or through the web interface at <https://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Publican&component=publican>.


🌟 AUTHOR 🌟

Jeff Fearn "<jfearn@redhat.com>" β€” ty for your service king 🫑


and that's the whole page, bestie. this is perl v5.26.2, dated 2018-07-08, straight outta the User Contributed Perl Documentation. she ate and left no crumbs πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from