Catman...nsform(3pm)

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

πŸ’– NAME πŸ’–

Catmandu::Fix::xml_transform β€” the fix that transforms XML using an XSLT stylesheet. That's it, that's the whole job description, and it eats.

This page is the Catman...nsform(3pm) one, living under User Contributed Perl Documentation, and bestie it's lowkey iconic.


πŸ¦‹ SYNOPSIS πŸ¦‹

# Transforms the 'xml' from marcxml to dublin core xml
xml_transform('xml',file => 'marcxml2dc.xsl');

🌸 DESCRIPTION 🌸

Okay so, this Catmandu::Fix transforms XML with an XSLT stylesheet. It's built on top of Catmandu::XML::Transformer, and the way it moves is honestly so clean: it'll transform an XML string into an XML string, MicroXML (XML::Struct) into MicroXML, and a DOM into a DOM. Type in, same type out. Main character energy fr fr. πŸ’…

🚨 But plot twist alert: if the stylesheet is intended to emit text ("<xsl:output method="text"/>"), then this fix always transforms produces a string. So yeah β€” text-emitting stylesheet means a string comes back out, no matter what vibe you started with.

You can specify one or more XSLT scripts with the argument file. One or multiple, she's flexible, we love that for her. 🫢


πŸŽ€ CONFIGURATION πŸŽ€

  • field β€” the data field to get XML from 🌈
  • file β€” one or more file names of optional XSLT scripts πŸ“‚
  • format β€” optional output format. Pick your fighter: "string", "struct", "simple", or "dom" ✨

And that's the whole page, bestie, you understood it, I'm so proud. πŸ₯Ή This was Catman...nsform(3pm) from perl v5.36.0, dated 2022-09-15. Go transform something gorgeous. πŸ’œπŸ¦‹

πŸ“¦ where this page comes from