<div dir="ltr"><div>Hi Mark,<br></div><div><br></div><div>Thank you for your reply! Sorry for the delay in responding back to you.</div><div><br></div><div><div>>> Can you try this? <br></div></div><div>>> my $cdata = $doc->createCDATASection($content);<br>>> my @req_params = (parameters => { xml => $cdata });<br><br></div><div>I tried this and it worked perfectly! Nice that it was so easy.</div><div><br></div><div>Just for the record, to make it super simple - I actually did this:</div><div><br></div><div>use XML::LibXML;</div><div>use File::Slurp;</div><div><br></div><div>my $xml_content = read_file($filepath, { binmode => 'utf8' });</div><div><code class="gmail-perl gmail-variable" style="font-size:12px;background:none rgb(245,245,245);white-space:pre;box-sizing:content-box;font-family:inherit;padding:0px;color:rgb(170,119,0);border-radius:0px;border:0px;float:none;height:auto;line-height:normal;margin:0px;outline:0px;overflow:visible;vertical-align:baseline;width:auto;min-height:auto">my $cdata_node</code><span style="color:rgb(51,51,51);font-family:Menlo,Monaco,"DejaVu Sans Mono",Consolas,"Bitstream Vera Sans Mono",Courier,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(245,245,245)"> </span><code class="gmail-perl gmail-plain" style="font-size:12px;background:none rgb(245,245,245);white-space:pre;box-sizing:content-box;font-family:inherit;padding:0px;color:black;border-radius:0px;border:0px;float:none;height:auto;line-height:normal;margin:0px;outline:0px;overflow:visible;vertical-align:baseline;width:auto;min-height:auto">= XML::LibXML::CDATASection->new( </code><code class="gmail-perl gmail-variable" style="font-size:12px;background:none rgb(245,245,245);white-space:pre;box-sizing:content-box;font-family:inherit;padding:0px;color:rgb(170,119,0);border-radius:0px;border:0px;float:none;height:auto;line-height:normal;margin:0px;outline:0px;overflow:visible;vertical-align:baseline;width:auto;min-height:auto">$xml_content</code><span style="color:rgb(51,51,51);font-family:Menlo,Monaco,"DejaVu Sans Mono",Consolas,"Bitstream Vera Sans Mono",Courier,"Courier New",monospace;font-size:12px;white-space:pre;background-color:rgb(245,245,245)"> </span><code class="gmail-perl gmail-plain" style="font-size:12px;background:none rgb(245,245,245);white-space:pre;box-sizing:content-box;font-family:inherit;padding:0px;color:black;border-radius:0px;border:0px;float:none;height:auto;line-height:normal;margin:0px;outline:0px;overflow:visible;vertical-align:baseline;width:auto;min-height:auto">);</code> <br></div><div>my @req_params = (parameters => { xml => $cdata_node }); <br></div><div><br></div><div>Thank you again for your help and also all that you have done!</div><div><br></div><div>Kind regards,</div><div><br></div><div>Christopher Taranto</div><div><br></div><div class="gmail_quote"><div dir="ltr">On Thu, Aug 30, 2018 at 11:38 PM Mark Overmeer <<a href="mailto:solutions@overmeer.net">solutions@overmeer.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi Chris,<br>
<br>
* Christopher Taranto (<a href="mailto:christopher@tokpela.com" target="_blank">christopher@tokpela.com</a>) [180830 19:19]:<br>
> How do you post an XML document as an embedded CData section?<br>
> <br>
> My test script is receiving a 500 server error because the XML that I am<br>
> sending is being escaped before it is being sent to the server.<br>
<br>
Of course it get escaped, to avoid the confusion between the documents.<br>
Probably, the server is sloppy in its implementation only expecting CDATA<br>
from its parser. CDATA is the better option in this case, but not the<br>
only option.<br>
<br>
> I have looked all over the documentation for many of the different modules<br>
> but I have not been able to find anything that has helped me.<br>
<br>
On many places where you add elements or attributes, you can not<br>
only pass values but also objects. For instance, a fully prepared<br>
XML::LibXML::Element object. You could try to pass a CDATA object.<br>
(If it does not work, we will make it work ;-)<br>
<br>
my $cdata = $doc->createCDATASection($content);<br>
my @req_params = (parameters => { xml => $cdata });<br>
<br>
Can you try this? If you get errors, please reply to me off-list<br>
until we have a fix. Hopefully we come to a text for the FAQ.<br>
-- <br>
Regards,<br>
MarkOv<br>
<br>
------------------------------------------------------------------------<br>
Mark Overmeer MSc MARKOV Solutions<br>
Mark@Overmeer.net <a href="mailto:solutions@overmeer.net" target="_blank">solutions@overmeer.net</a><br>
<a href="http://Mark.Overmeer.net" rel="noreferrer" target="_blank">http://Mark.Overmeer.net</a> <a href="http://solutions.overmeer.net" rel="noreferrer" target="_blank">http://solutions.overmeer.net</a><br>
<br>
</blockquote></div></div>