<br><br><div class="gmail_quote">On Fri, Mar 4, 2011 at 9:57 PM, Francisco Obispo <span dir="ltr"><<a href="mailto:fobispo@isc.org">fobispo@isc.org</a>></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'm not reading the CDATA section directly, I'm just asking for the value of the 'content' 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->cdata call. I could see you had knowledge that there was a <content> tag and was CDATA, where I needed a way to preserve the CDATA sections without knowing if any child of <result> 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->new;</div></div></div><div class="gmail_quote"><div><div>my $doc = XML::LibXML::Document->new( '1.0', 'UTF-8' );</div></div></div><div class="gmail_quote">
<div><div>my $root = $doc->createElement( 'testResults' );</div></div></div><div class="gmail_quote"><div><div>$doc->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->parse_file($file);</div></div></div><div class="gmail_quote"><div><div>
<br></div></div></div><div class="gmail_quote"><div><div> $root->appendChild( $_ ) for $doc->getElementsByTagName( 'result' );</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->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>