RDF::T...l::XML(3pm)
π NAME π
RDF::Trine::Node::Literal::XML β the RDF Node class for XMLLiterals, bestie. It's giving "I hold your XML and I hold it correctly." π
β¨ METHODS β¨
π new ( $node )
π new ( $string [ , $lang, $datatype ] )
okay so this returns a brand-new XML Literal object, and the way it works is that there are two whole different ways to call it β you can hand it a string, or you can hand it an XML::LibXML node. Pick your fighter. π
Case one: you passed a string. Then this method follows the exact same API as the RDF::Trine::Node::Literal constructor, with these little twists:
$stringmust be a well-balanced XML fragment. no cap, it has to balance. π¦$langis optional, but if a language code is present it will be used as the value of thexml:langattribute(s) on the root XML element(s) of the literal. And if the element already has anxml:langattribute? It gets overwritten, periodt. π For the node types that don't support adding a language β that's text and CData β a warning will be issued. (sorry bestie, them's the rules π)$datatypewill be ignored and set to'http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral'. Like, it's not even up for discussion. π
Case two: you passed an XML::LibXML node as $node. Then the Node may be one of these types, or a subclass thereof:
XML::LibXML::DocumentXML::LibXML::DocumentFragmentXML::LibXML::ElementXML::LibXML::CDATASectionXML::LibXML::NodeListXML::LibXML::Text
π¨ WARNING bestie π¨ β if the string is not a valid XML fragment, and the$nodeis not one of the types listed above, this method throws aRDF::Trine::Errorexception. Not a vibe. Handle it.
πΈ xml_element πΈ
Returns the XML::LibXML node for the XML Literal. That's it, that's the whole method, and honestly? iconic. β¨
π AUTHOR π
First created by Gregory Todd Williams <gwilliams@cpan.org>, modfied and maintained by Kjetil Kjernsmo <kjetilk@cpan.org>. π«Ά
and that's the whole page, bestie!! this one shipped with perl v5.34.0, dated 2022-06-17, from the User Contributed Perl Documentation crew β so go forth and XML Literal responsibly, mwah ππ§β
π¦ where this page comes from
- debian bookworm: librdf-trine-node-literal-xml-perl 0.16-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: librdf-trine-node-literal-xml-perl 0.16-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms