.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "RDF::Trine::Node::Literal::XML 3pm" .TH RDF::Trine::Node::Literal::XML 3pm 2024-03-07 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME RDF::Trine::Node::Literal::XML \- RDF Node class for XMLLiterals .SH METHODS .IX Header "METHODS" .ie n .IP """new ( $node )""" 4 .el .IP "\f(CWnew ( $node )\fR" 4 .IX Item "new ( $node )" .PD 0 .ie n .IP """new ( $string [ , $lang, $datatype ] )""" 4 .el .IP "\f(CWnew ( $string [ , $lang, $datatype ] )\fR" 4 .IX Item "new ( $string [ , $lang, $datatype ] )" .PD Returns a new XML Literal object. This method can be used in two different ways: It can either be passed a string or an XML::LibXML node. .Sp In the case of passing a string, this method follows the same API as the RDF::Trine::Node::Literal constructor, but: .RS 4 .IP \(bu 4 \&\f(CW$string\fR must be a well-balanced XML fragment =item * \f(CW$lang\fR is optional, but if a language code is present it will be used as the value of \f(CW\*(C`xml:lang\*(C'\fR attribute(s) on the root XML element(s) of the literal. If the element already has an \f(CW\*(C`xml:lang\*(C'\fR attribute it will be overwritten. For the node types that doesn't support adding a language, text and CData, a warning will be issued. =item * \f(CW$datatype\fR will be ignored and set to 'http://www.w3.org/1999/02/22\-rdf\-syntax\-ns#XMLLiteral' .RE .RS 4 .Sp In the case of using a XML::LibXML node \f(CW$node\fR, the Node may be one of these types or a subclass thereof: .IP \(bu 4 XML::LibXML::Document =item * XML::LibXML::DocumentFragment =item * XML::LibXML::Element =item * XML::LibXML::CDATASection =item * XML::LibXML::NodeList =item * XML::LibXML::Text .RE .RS 4 .Sp If the string is not a valid XML fragment, and the \f(CW$node\fR is not of one of the above types, this method throws a RDF::Trine::Error exception. .RE .ie n .IP """xml_element""" 4 .el .IP \f(CWxml_element\fR 4 .IX Item "xml_element" Returns the XML::LibXML node for the XML Literal. .SH AUTHOR .IX Header "AUTHOR" First created by Gregory Todd Williams , modfied and maintained by Kjetil Kjernsmo