<br><br><div class="gmail_quote">On Fri, Mar 4, 2011 at 9:57 PM, Francisco Obispo <span dir="ltr">&lt;<a href="mailto:fobispo@isc.org">fobispo@isc.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Well, if look at my code, I&#39;m not reading the CDATA section directly, I&#39;m just asking for the value of the &#39;content&#39; tag, if it has a CDATA element in it, well, XML::LibXML will take care of it.<br>
<br></blockquote><div> </div><div>Oh, right.  I was confused by your explicit $writer-&gt;cdata call.  I could see you had knowledge that there was a &lt;content&gt; tag and was CDATA, where I needed a way to preserve the CDATA sections without knowing if any child of &lt;result&gt; had a CDATA section ahead of time.</div>

<div><br></div><div>So, what what I ended up with is this:</div><div><br></div></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div class="gmail_quote"><div><div>

use strict;</div></div></div><div class="gmail_quote"><div><div>use XML::LibXML;</div></div></div><div class="gmail_quote"><div><div>use Data::Dumper;</div></div></div><div class="gmail_quote"><div><div><br></div></div></div>

<div class="gmail_quote"><div><div>my $parser = XML::LibXML-&gt;new;</div></div></div><div class="gmail_quote"><div><div>my $doc = XML::LibXML::Document-&gt;new( &#39;1.0&#39;, &#39;UTF-8&#39; );</div></div></div><div class="gmail_quote">

<div><div>my $root = $doc-&gt;createElement( &#39;testResults&#39; );</div></div></div><div class="gmail_quote"><div><div>$doc-&gt;setDocumentElement( $root );</div></div></div><div class="gmail_quote"><div><div><br></div>

</div></div><div class="gmail_quote"><div><div>foreach my $file (@ARGV) {</div></div></div><div class="gmail_quote"><div><div>   my $doc = $parser-&gt;parse_file($file);</div></div></div><div class="gmail_quote"><div><div>

<br></div></div></div><div class="gmail_quote"><div><div>   $root-&gt;appendChild( $_ ) for $doc-&gt;getElementsByTagName( &#39;result&#39; );</div></div></div><div class="gmail_quote"><div><div><br></div></div></div><div class="gmail_quote">

<div><div>}</div></div></div><div class="gmail_quote"><div><div><br></div></div></div><div class="gmail_quote"><div><div>print $doc-&gt;toString;</div></div></div></blockquote><div class="gmail_quote"><div><br></div><div>

Pretty simple.</div><div><br></div><div>Thanks very much for your help, Francisco.</div><div><br></div></div>-- <br>Bill Moseley<br><a href="mailto:moseley@hank.org" target="_blank">moseley@hank.org</a><br>