Catman..._write(3pm)

πŸ“¦
version 0.17 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Catmandu::Fix::xml_write πŸ’–

okay bestie, gather round, because this little fix is literally the glow-up station for your XML. welcome to Catmandu::Fix::xml_write β€” she serializes XML, and she does it beautifully ✨


🌸 NAME 🌸

Catmandu::Fix::xml_write β€” serialize XML πŸ¦‹


✨ SYNOPSIS ✨

# serialize XML structure given in field 'xml'
xml_write(xml)
xml_write(xml, pretty: 1)

like... that's it. that's the whole vibe. one line and your XML is out here looking iconic πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

so what does she actually do? this Catmandu::Fix serializes XML documents πŸŽ€

and the documents she takes are either:

  • chillin' in MicroXML form β€” the kind that XML::Struct uses
  • or straight-up an instance of XML::LibXML::Document

and in short? she's a wrapper around XML::Struct::Writer. that's the whole tea. no cap, that's genuinely the entire description. she's a little delegator, a middlewoman, a hype-girl for XML::Struct::Writer 🫢


🌈 CONFIGURATION 🌈

here's where you get to customize her, bestie. the options:

  • attributes β€” set this to false when you do not want her expecting attribute hashes inside the XML structure. so if attribute hashes aren't your thing, flip her off. gently. with attributes: 0 πŸ™ˆ
  • pretty β€” set to 1 and she pretty-prints the XML. yes, she will make it pretty. it's giving main character formatting, it's giving indentation, it's giving readable πŸ˜­πŸ’–
  • xmldecl β€” literally just sitting here. the original page lists her with zero notes. she's mysterious. she's lowkey an enigma. we respect that πŸ‘‘
  • version β€” also here, also note-less. iconic behaviour honestly.
  • encoding β€” same energy. present, accounted for, no commentary. we love a quiet queen πŸ’œ
  • standalone β€” and rounding out the mystery squad. listed, no description, no drama. periodt.
ngl the last four options come with no explanation on the original page, so I'm not about to invent one for you. they're there, they exist, that's the whole story. iykyk 🧚

πŸ”₯ SEE ALSO πŸ”₯

  • Catmandu::Fix::xml_read β€” her other half, the reader to her writer, the inhale to her exhale. go check her out πŸ¦‹

and that's the page, bestie!! go serialize something gorgeous πŸŒΈπŸ’…

mwah πŸ’‹ β€” this was Catmandu::Fix::xml_write, documented in perl v5.36.0, dated 2022-09-15. stay slay, stay serialized. πŸŽ€βœ¨

πŸ“¦ where this page comes from