<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">if rrdrestore finds a error it spits out an error similar to <div><br></div><div><div><div style="orphans: 2; text-align: -webkit-auto; text-indent: 0px; widows: 2; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="orphans: 2; text-align: -webkit-auto; text-indent: 0px; widows: 2; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span style="font-family: Helvetica; font-size: medium; ">ERROR: line 210: expected <ds> element but found </cdp_prep></span></div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><br></div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Which is annoying because line 210 isn't the line number in the file, but the xml parser line number.</div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><br></div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Anyway I found this script useful to finding the incorrect element.</div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><br></div><div><div><font face="Lucida Grande"><span style="font-size: 10px;">use XML::LibXML;</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;"><br></span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">my $parser = XML::LibXML->new( line_numbers => 1 );</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">my $xml = $parser->load_xml( location => '<filename>' );</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">foreach my $nodes ( $xml->childNodes ) {</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;"> hasChild($nodes);</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">}</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;"><br></span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">sub hasChild {</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;"> my $nodes = shift;</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;"> if ( $nodes->hasChildNodes() ) {</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;"> foreach my $node ( $nodes->childNodes ) {</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;"> my $line = $node->line_number();</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;"> my $nodeStr = $node->nodeName();</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;"> my $nodeval = $node->to_literal();</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;"> print "line $line :: $nodeStr :: $nodeval\n";</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;"> hasChild($node);</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;"> }</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;"> }</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">}</span></font></div></div><div><font face="Lucida Grande"><span style="font-size: 10px;"><br></span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">I'm sure someone could write a much better script, but here is my solution.</span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;"><br></span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;"><br></span></font></div><div><font face="Lucida Grande"><span style="font-size: 10px;">Sean</span></font></div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">=======================================</div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Sean Whitney</div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">PMB #120, 16505A SE First Street<br>Vancouver, WA 98684</div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">T. 360.326.2740 </div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">C. 360.607.7945</div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">F. 815.364.0687</div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">aim: seanmwhitney</div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">email: <a href="mailto:sean@visionary-networks.com">sean@visionary-networks.com</a></div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">skype: sean_whitney</div><div style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">=======================================</div></div></div>
</div>
<br></div></body></html>