[Xml-compile] XML document as an embedded CData section
Mark Overmeer
solutions at overmeer.net
Wed Sep 5 08:46:09 GMT 2018
Hi Chris,
(Concluding message back to the mailinglist)
> >> Can you try this?
> >> my $cdata = $doc->createCDATASection($content);
> >> my @req_params = (parameters => { xml => $cdata });
>
* Christopher Taranto (christopher at tokpela.com) [180905 03:41]:
> I tried this and it worked perfectly! Nice that it was so easy.
> Just for the record, to make it super simple - I actually did this:
>
> use XML::LibXML;
> use File::Slurp;
>
> my $xml_content = read_file($filepath, { binmode => 'utf8' });
> my $cdata_node = XML::LibXML::CDATASection->new( $xml_content );
> my @req_params = (parameters => { xml => $cdata_node });
"Officially" you should use the $doc->create* methods, because some
of the compenents need info from the $doc configuration.
I have added the example to XML::Compile::FAQ
--
Regards,
MarkOv
------------------------------------------------------------------------
Mark Overmeer MSc MARKOV Solutions
Mark at Overmeer.net solutions at overmeer.net
http://Mark.Overmeer.net http://solutions.overmeer.net
More information about the Xml-compile
mailing list