XML::G...mation(3pm)

πŸ“¦
version 0.004 Β· 3 versions
, in debian bookworm, ubuntu jammy, ubuntu noble

πŸ’– XML::GRDDL::Transformation πŸ’–

okay bestie, so you know how some things in life are just... a transformation? no? well. this module is literally that. it's XML::GRDDL::Transformation β€” the whole vibe is that it represents a transformation. yes, that's the NAME. we're starting strong. periodt. ✨


🌸 DESCRIPTION 🌸

ngl, the interface is a little weird. that's it. that's the description. the original devs said it and honestly? respect. they were keeping it real. πŸ™ˆ


πŸŽ€ Constructor πŸŽ€

XML::GRDDL::Transformation->new($turi, $duri, [$grddl])

okay so this is the glow-up moment β€” it constructs a new transformation object. slay. πŸ’…

and here's what you're feeding it:

  • $turi β€” the URI of the transformation itself. it's giving main character. ✨
  • $duri β€” the document URI. this one's doing two jobs (we love a multitasker): it's used for sending an HTTP Referer header, and it's used for resolving relative URIs found in the document. 🫢
  • $grddl β€” optional, and it's an XML::GRDDL object. it gets used as a cache between requests, and also for its ua method. iykyk. πŸ‘‘

πŸ¦‹ Methods πŸ¦‹

$transformation->uri

returns the URI of the transformation. that's it. short, sweet, iconic. πŸŽ€

$transformation->transform($xml)

this one transforms some XML for you β€” and it'll take either a well-formed XML string, or an XML::LibXML::Document. it returns a string. 🌈

plot twist incoming: if you call it in list context, it returns a string, media type pair instead. so know which context you're in, bestie. not me getting caught out by that. πŸ’€

$transformation->model($xml)

transforms some XML and then parses the result as RDF. returns an RDF::Trine::Model. chef's kiss. πŸ”₯

and the intermediate RDF format? it can be literally any format supported by RDF::RDFa::Parser or RDF::Trine::Parser, including RDF/XML, Turtle and XHTML+RDFa. obsessed with the range honestly. ✨


πŸ’œ SEE ALSO πŸ’œ

  • XML::GRDDL.
  • XML::GRDDL::Transformation::XSLT_1, XML::GRDDL::Transformation::RDF_EASE.

go read those next, bestie. the lore runs deep. πŸ“š


πŸ‘‘ AUTHOR πŸ‘‘

Toby Inkster <tobyink@cpan.org>.

legend behaviour. 🫢


Copyright 2008-2012 Toby Inkster

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

so go forth and remix, bb. it's free software. πŸ’–


🌸 DISCLAIMER OF WARRANTIES 🌸

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

and that's on periodt β€” no promises, no guarantees, no cap. 😭


and that's the whole page, bestie!! πŸ’…βœ¨ this was perl v5.32.1, dated 2021-09-19 β€” yes she's a lil vintage but she still ate, fr fr. πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from