<?php
// xmllint_validation.php
// RJM Programming
// June, 2024
 $bc='';
 $rowseq='';
 $colseq=' cols=5 ';
 $vsnone='none';
 $prefn='Please enter either HTML or XML file to validate ...';
 $pth='';
 $rn='' .rand(1,78477554);
 $results='';
 $precontents='';
 $contents='';
 $fn='';
 if ((!isset($_GET['htmlfile']) || strlen(('' . $_GET['htmlfile'])) == 0) && isset($_GET['content'])) {
   $_GET['htmlfile']=$_GET['content'];
 }
 if ((!isset($_POST['htmlfile']) || strlen(('' . $_POST['htmlfile'])) == 0) && isset($_POST['content'])) {
   $_POST['htmlfile']=$_POST['content'];
 } 
 if (isset($_GET['htmlfile']) && strlen(('' . $_GET['htmlfile'])) > 0) {
   if (substr(trim(urldecode($_GET['htmlfile'])) . ' ', 0, 1) == '<') {
   $contents=trim(str_replace('+',' ',urldecode($_GET['htmlfile'])));
   if (strpos(strtolower(explode('>', $contents)[0]), 'html') !== false) {
   $fn='/tmp/html_' . $rn . '.html';
   } else if (strpos(strtolower(explode('>', $contents)[0]), 'xml') !== false) {
   $fn='/tmp/xml_' . $rn . '.xml';
   } 
   file_put_contents($fn, $contents);
   } else {
   $fn=str_replace('+',' ',urldecode($_GET['htmlfile']));
   }
   if ($fn != '') {
   if (strpos($fn, 'localhost') !== false) {
     $rhs=explode('localhost' . explode('/', explode('localhost', $fn)[1])[0], $fn)[1];
     $fn=$_SERVER['DOCUMENT_ROOT'] . $rhs;
     $pth='/usr/bin/';
   } else if (strpos($fn, 'rjmprogramming.com.au') !== false) {
     $rhs=explode('rjmprogramming.com.au' . explode('/', explode('rjmprogramming.com.au', $fn)[1])[0], $fn)[1];
     $fn=$_SERVER['DOCUMENT_ROOT'] . $rhs;
   } else if (strpos($_SERVER['SERVER_NAME'], 'localhost') !== false) { 
     $pth='/usr/bin/';
   } 
   }
   if (file_exists($fn)) {
   if ($contents == '') {
     $contents=file_get_contents($fn);
   }
   $prefn=$fn;
   $fn=realpath($fn);
 if (strpos(strtolower($fn), '.xml') !== false) {
   $vsnone='block';
   $results=shell_exec($pth . 'xmllint --valid --noout ' . $fn . ' 2> ' . ' ' . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'xmllint.err');
   if (file_exists(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'xmllint.err')) {
     $results.="\n";
     $results.=file_get_contents(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'xmllint.err');
     unlink(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'xmllint.err');
   }
 } else if (strpos(strtolower($fn), '.htm') !== false) {
   $vsnone='block';
   $results=shell_exec($pth . 'xmllint --html --valid --noout ' . $fn . ' 2> ' . ' ' . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'xmllint.err');
   if (file_exists(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'xmllint.err')) {
     $results.="\n";
     $results.=file_get_contents(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'xmllint.err');
     unlink(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'xmllint.err');
   }
 }
   if (strpos($fn, '/tmp/') !== false) { unlink($fn);  }
   } else {
   $contents='';
   if (strpos($fn, '/tmp/') !== false) { unlink($fn);  }
   }
 } else if (isset($_POST['htmlfile']) && strlen(('' . $_POST['htmlfile'])) > 0) {
   if (substr(trim(urldecode($_POST['htmlfile'])) . ' ', 0, 1) == '<') {
   $contents=trim(str_replace('+',' ',urldecode($_POST['htmlfile'])));
   if (strpos(strtolower(explode('>', $contents)[0]), 'html') !== false) {
   $fn='/tmp/html_' . $rn . '.html';
   } else if (strpos(strtolower(explode('>', $contents)[0]), 'xml') !== false) {
   $fn='/tmp/xml_' . $rn . '.xml';
   } 
   file_put_contents($fn, $contents);
   } else {
   $fn=str_replace('+',' ',urldecode($_POST['htmlfile']));
   }
   if ($fn != '') {
   if (strpos($fn, 'localhost') !== false) {
     $rhs=explode('localhost' . explode('/', explode('localhost', $fn)[1])[0], $fn)[1];
     $fn=$_SERVER['DOCUMENT_ROOT'] . $rhs;
     $pth='/usr/bin/';
   } else if (strpos($fn, 'rjmprogramming.com.au') !== false) {
     $rhs=explode('rjmprogramming.com.au' . explode('/', explode('rjmprogramming.com.au', $fn)[1])[0], $fn)[1];
     $fn=$_SERVER['DOCUMENT_ROOT'] . $rhs;
   } else if (strpos($_SERVER['SERVER_NAME'], 'localhost') !== false) { 
     $pth='/usr/bin/';
   }
   }
   if (file_exists($fn)) {
   $prefn=$fn;
   if ($contents == '') {
     $contents=file_get_contents($fn);
   }
   $fn=realpath($fn);
 if (strpos(strtolower($fn), '.xml') !== false) {
   $vsnone='block';
   $results=shell_exec($pth . 'xmllint --valid --noout ' . $fn . ' 2> ' . ' ' . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'xmllint.err');
   if (file_exists(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'xmllint.err')) {
     $results.="\n";
     $results.=file_get_contents(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'xmllint.err');
     unlink(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'xmllint.err');
   }
 } else if (strpos(strtolower($fn), '.htm') !== false) {
   $vsnone='block';
   $results=shell_exec($pth . 'xmllint --html --valid --noout ' . $fn . ' 2> ' . ' ' . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'xmllint.err');
   if (file_exists(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'xmllint.err')) {
     $results.="\n";
     $results.=file_get_contents(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'xmllint.err');
     //file_put_contents('xxx.xxx', $results);
     unlink(rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'xmllint.err');
   }
 }
   if (strpos($fn, '/tmp/') !== false) { unlink($fn);  }
   } else {
   $contents='';
   if (strpos($fn, '/tmp/') !== false) { unlink($fn);  }
   }
 }
 if ($contents != '') {
   $lines=explode("\n", $contents);
   $rowseq=' rows=' . sizeof($lines) . ' ';
   for ($ii=1; $ii<=sizeof($lines); $ii++) {
     $precontents.='' . $ii . "\n";
   }
 }
 if (isset($_GET['browsecontents'])) {
   if (strlen($_GET['browsecontents']) > 0) {
     $prefn=str_replace('+',' ',urldecode($_GET['browsecontents']));
     $bc='#' . urlencode($prefn);
   }
 }
 if (isset($_POST['browsecontents'])) {
   if (strlen($_POST['browsecontents']) > 0) {
     $prefn=str_replace('+',' ',urldecode($_POST['browsecontents']));
     $bc='#' . urlencode($prefn);
   }
 }
?>
<html>
<head>
<title>XML Lint Usage - RJM Programming - June, 2024</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type='text/javascript'>
// /home/virtfs/rjmprogr/usr/local/cpanel/3rdparty/bin/xmllint --html --valid --noout 
var bc=decodeURIComponent(("<?php echo $bc ; ?>").replace(/^\#/g,'')).replace(/\+/g,' ');
var preclientcontents='';
var clientcontents=(location.search + ('' + location.hash).replace('browsecontents','contentsbrowse').replace(/^\#/g,'')).split('contents=')[1] ? dopre(decodeURIComponent((location.search + ('' + location.hash).replace(/^\#/g,'')).replace('browsecontents','contentsbrowse').split('contents=')[1].split('&')[0].split('#')[0])) : ""
//alert(clientcontents);
var beforebih=''; //(iois.srcdoc.toLowerCase().indexOf('<body') == -1 ? iois.srcdoc : '' + iois.srcdoc.replace('<BODY','<body').replace('</BODY>','</body>').split('<body')[1].split('</body>')[0].split('</body>')[0].replace(iois.srcdoc.replace('<BODY','<body').replace('</BODY>','</body>').split('<body')[1].split('</body>')[0].split('>')[0] + '>',''));
var afterbih='', woois=null;
var linenum=0, thesel='', showsel=false, reng='';
var s1=null, s2=null;
var s1rect=null, s2rect=null;
var redrgb='rgba(255,0,0,0.2)';
var greenrgb='rgba(0,255,0,0.2)';
var orangergb='rgba(255,165,0,0.2)';
var thergb=orangergb, tfis='';
var rowseq="<?php echo trim(str_replace('rows=','',$rowseq)); ?>";
var x1=0, x2=0, y1=0, y2=0;
var ourdelim=':', ourfindsare=[];
var ihsms='', ihemail='';
var paconto=null;

// Thanks to https://stackoverflow.com/questions/7108270/scrolling-2-different-elements-in-same-time
function select_scroll_1(e) { s2.scrollTop = s1.scrollTop; }
function select_scroll_2(e) { s1.scrollTop = s2.scrollTop; }

function getaconto() {
  return paconto;
}

function getrowseq() {
  return rowseq;
}

function dopre(cwhat) {
  var clines=[];
  if (cwhat.replace(/\^null/g,'').replace(/\^undefined/g,'').trim() != '' && preclientcontents == '') {
  //alert('cwhat=' + cwhat);
    clines=cwhat.replace(/\^null/g,'').replace(/\^undefined/g,'').trim().split(String.fromCharCode(10));
    for (var ic=1; ic<=clines.length; ic++) {
       if (preclientcontents == '') {
         preclientcontents='' + ic;
       } else {
         preclientcontents+=String.fromCharCode(10) + '' + ic;
       }
    }
  }
  return cwhat.replace(/\^null/g,'').replace(/\^undefined/g,'').trim();
}

function onl() {
const sanitizer = new Sanitizer();  // Default sanitizer;

// Get the frame and its Document object
const frame_element = document.getElementById("userFrame");
const unsanitized_frame_tree = frame_element.contentWindow.document;
console.log(unsanitized_frame_tree);
console.log(frame_element.contentWindow.document.body.innerHTML.length);

// Sanitize the document tree and update the frame.
const sanitized_frame_tree = sanitizer.sanitize(unsanitized_frame_tree);
console.log(sanitized_frame_tree);
frame_element.replaceChildren(sanitized_frame_tree);
console.log(frame_element.contentWindow.document.body.innerHTML.length);
}

function ifixit(iois) {
  if (iois != null) {
    var aconto = (iois.contentWindow || iois.contentDocument);
    if (aconto != null) {
     if (aconto.document) { aconto = aconto.document; }
     if (aconto.body != null) {
const unsanitized_string = (iois.srcdoc.toLowerCase().indexOf('<body') == -1 ? iois.srcdoc : '' + iois.srcdoc.replace('<BODY','<body').replace('</BODY>','</body>').split('<body')[1].split('</body>')[0].split('</body>')[0].replace(iois.srcdoc.replace('<BODY','<body').replace('</BODY>','</body>').split('<body')[1].split('</body>')[0].split('>')[0] + '>',''));  // Unsanitized string of HTML
beforebih=unsanitized_string.replace(/\>/g,'&gt;').replace(/\</g,'&lt;');
document.getElementById('before').innerHTML=beforebih;
const sanitizer = new Sanitizer();  // Default sanitizer;

// Sanitize the string
const sanitizedBody = sanitizer.sanitizeFor("body", unsanitized_string);

//We can verify the returned element type, and view sanitized HTML in string form:
console.log(sanitizedBody instanceof HTMLBodyElement);
// true
console.log(sanitizedBody.innerHTML)
// "abc  def"

// At some point later…

// Get the element to update. This must be a div to match our sanitizeFor() context.
// Set its content to be the children of our sanitized element.
iois.replaceChildren(sanitizedBody.children);
//console.log(aconto);
afterbih=aconto.body.innerHTML.replace(/\>/g,'&gt;').replace(/\</g,'&lt;');
document.getElementById('after').innerHTML=afterbih;
     }
    }
  }
}

function trythis() {
  var newsd=prompt('Optionally enter new iframe content to sanitize.', beforebih.replace(/\&gt\;/g,'>').replace(/\&lt\;/g,'<'));
  if (newsd) {
    if (newsd != beforebih.replace(/\&gt\;/g,'>').replace(/\&lt\;/g,'<')) {
      document.getElementById("userFrame").srcdoc=newsd;
    }
  }
}

function ronecheck() {
   if (document.getElementById('result1').innerHTML != '') {
      document.getElementById('incoming').innerHTML=document.getElementById('result1').value;
      document.getElementById('result1').innerHTML='';
      document.getElementById('result1').value='';
      document.getElementById('myhxfile').name='xx';
      //alert(document.getElementById('outputname').value + ' ... ' + document.getElementById('cto').value);
      if (document.getElementById('outputname').value.trim() != '') {
      document.getElementById('ihid').value='' + decodeURIComponent(('' + location.hash).replace(/^\#/g,'')).split('&')[0];
      document.getElementById('ihid').name='browsecontents';
      document.getElementById('myform').action=document.getElementById('myform').action.split('#')[0] + '#' + encodeURIComponent(document.getElementById('outputname').value);
      } else {
      document.getElementById('myform').action=document.getElementById('myform').action.split('#')[0];
      }
      //alert('BC=' + bc);
      document.getElementById('mysub').click();
   }
}

function pcheckit(iois) {
   var xpaconto = (iois.contentWindow || iois.contentDocument);
   if (xpaconto != null) {
   if (xpaconto.document) { xpaconto = xpaconto.document; }
   if (xpaconto.body != null) {
         xpaconto.getElementsByTagName('h1')[0].style.opacity='0.0';
         if (1 == 1) { xpaconto.getElementsByTagName('h3')[0].style.opacity='0.0'; }
         //if (1 == 1) { xpaconto.getElementsByTagName('h4')[0].style.opacity='0.0'; }
   }
   }
}

function s1click(e) {
       var theheight=eval(eval('' + s1rect.height) / rowseq);
       var codelines=s2.value.split(String.fromCharCode(10));
       var errdetail='', ierr=0, linenum=0;
       if (e.touches) {
       if (e.touches[0].pageX) {
       x1=(eval(e.touches[0].pageX + document.body.scrollLeft * 1) * 1);
       y1=(eval(e.touches[0].pageY + eval(eval(e.touches[0].pageY % theheight) - theheight) + document.body.scrollTop * 1) * 1);
       linenum=Math.floor(eval(1 + eval(eval(e.touches[0].pageY + document.body.scrollTop - s1rect.top) / theheight)));
       } else {
       x1=(eval(e.touches[0].clientX + document.body.scrollLeft * 1) * 1);
       y1=(eval(e.touches[0].clientY + eval(eval(e.touches[0].clientY % theheight) - theheight) + document.body.scrollTop * 1) * 1);
       linenum=Math.floor(eval(1 + eval(eval(e.touches[0].clientY + document.body.scrollTop - s1rect.top) / theheight)));
       }
       } else if (e.clientX || e.clientY) {
        x1=(e.clientX + document.body.scrollLeft * 1);
        y1=(e.clientY + eval(eval(e.clientY % theheight) - theheight) + document.body.scrollTop * 1);
        linenum=Math.floor(eval(1 + eval(eval(e.clientY + document.body.scrollTop - s1rect.top) / theheight)));
       } else {
        x1=(e.pageX + document.body.scrollLeft * 1);
        y1=(e.pageY + eval(eval(e.pageY % theheight) - theheight) + document.body.scrollTop * 1);
        linenum=Math.floor(eval(1 + eval(eval(e.pageY + document.body.scrollTop - s1rect.top) / theheight)));
       } 
       //alert('' + linenum + ' ' + y1 + '/' + document.body.scrollTop + ' ... ' + s1.scrollTop + ' ... ' + s1rect.top + '/' + s1rect.y + ' +++ ' + theheight);
       var finds=document.getElementById('outgoing').value.split(':' + linenum + ':');
       thergb=greenrgb;
       s1.setAttribute('data-status', '');
       if (eval('' + finds.length) > 1) {
       for (ierr=1; ierr<finds.length; ierr++) {
         errdetail+=String.fromCharCode(10) + finds[eval(-1 + ierr)].split(':' + linenum + ':')[0].split(String.fromCharCode(10))[eval(-1 + finds[eval(-1 + ierr)].split(':' + linenum + ':')[0].split(String.fromCharCode(10)).length)] + ':' + linenum + ':' + finds[eval(0 + ierr)].split(String.fromCharCode(10))[0];
       }
       errdetail+=String.fromCharCode(10);
       thergb=redrgb;
       s1.setAttribute('data-status', ' (has errors ... ' + errdetail + ' ... over to the right)');
       }
       s1.title='' + linenum;
       s2.title='' + codelines[eval(-1 + linenum)];
       y1-=eval('' + s1rect.top);
       // linear-gradient(to right, yellow, yellow 20%, #009966 20%, #009966 80%, purple 80%, purple);  
       //alert('linear-gradient(to bottom, white, white ' + y1 + 'px, ' + thergb + ' ' + y1 + 'px, ' + thergb + ' ' + eval(y1 + eval('' + s2rect.height) / rowseq) + 'px,  white ' + eval(y1 + eval('' + s2rect.height) / rowseq) + 'px, white)');  
       s2.style.backgroundImage='linear-gradient(to bottom, white, white ' + y1 + 'px, ' + thergb + ' ' + y1 + 'px, ' + thergb + ' ' + eval(y1 + eval('' + s2rect.height) / rowseq) + 'px,  white ' + eval(y1 + eval('' + s2rect.height) / rowseq) + 'px, white)'; 
       s1.style.backgroundImage='linear-gradient(to bottom, white, white ' + y1 + 'px, ' + thergb + ' ' + y1 + 'px, ' + thergb + ' ' + eval(y1 + eval('' + s2rect.height) / rowseq) + 'px,  white ' + eval(y1 + eval('' + s2rect.height) / rowseq) + 'px, white)'; 
}

function s2click(e) {
       var theheight=eval(eval('' + s2rect.height) / rowseq);
       var codelines=s2.value.split(String.fromCharCode(10));
       var errdetail='', ierr=0, linenum=0;
       if (e.touches) {
       if (e.touches[0].pageX) {
       x2=(eval(e.touches[0].pageX + document.body.scrollLeft * 1) * 1);
       y2=(eval(e.touches[0].pageY + eval(eval(e.touches[0].pageY % theheight) - theheight) + document.body.scrollTop * 1) * 1);
       linenum=Math.floor(eval(1 + eval(eval(e.touches[0].pageY + document.body.scrollTop - s2rect.top) / theheight)));
       } else {
       x2=(eval(e.touches[0].clientX + document.body.scrollLeft * 1) * 1);
       y2=(eval(e.touches[0].clientY + eval(eval(e.touches[0].clientY % theheight) - theheight) + document.body.scrollTop * 1) * 1);
       linenum=Math.floor(eval(1 + eval(eval(e.touches[0].clientY + document.body.scrollTop - s2rect.top) / theheight)));
       }
       } else if (e.clientX || e.clientY) {
        x2=(e.clientX + document.body.scrollLeft * 1);
        y2=(e.clientY + eval(eval(e.clientY % theheight) - theheight) + document.body.scrollTop * 1);
        linenum=Math.floor(eval(1 + eval(eval(e.clientY + document.body.scrollTop - s2rect.top) / theheight)));
       } else {
        x2=(e.pageX + document.body.scrollLeft * 1);
        y2=(e.pageY + eval(eval(e.pageY % theheight) - theheight) + document.body.scrollTop * 1);
        linenum=Math.floor(eval(1 + eval(eval(e.pageY + document.body.scrollTop - s2rect.top) / theheight)));
       } 
       var finds=document.getElementById('outgoing').value.split(':' + linenum + ':');
       thergb=greenrgb;
       s1.setAttribute('data-status', '');
       if (eval('' + finds.length) > 1) {
       for (ierr=1; ierr<finds.length; ierr++) {
         errdetail+=String.fromCharCode(10) + finds[eval(-1 + ierr)].split(':' + linenum + ':')[0].split(String.fromCharCode(10))[eval(-1 + finds[eval(-1 + ierr)].split(':' + linenum + ':')[0].split(String.fromCharCode(10)).length)] + ':' + linenum + ':' + finds[eval(0 + ierr)].split(String.fromCharCode(10))[0];
       }
       errdetail+=String.fromCharCode(10);
       thergb=redrgb;
       s1.setAttribute('data-status', ' (has errors ... ' + errdetail + ' ... over to the right)');
       }
       s1.title='' + linenum;
       s2.title='' + codelines[eval(-1 + linenum)];
       y2-=eval('' + s2rect.top);
       s2.style.backgroundImage='linear-gradient(to bottom, white, white ' + y2 + 'px, ' + thergb + ' ' + y2 + 'px, ' + thergb + ' ' + eval(y2 + eval('' + s1rect.height) / rowseq) + 'px,  white ' + eval(y1 + eval('' + s1rect.height) / rowseq) + 'px, white)'; 
       s1.style.backgroundImage='linear-gradient(to bottom, white, white ' + y2 + 'px, ' + thergb + ' ' + y2 + 'px, ' + thergb + ' ' + eval(y2 + eval('' + s1rect.height) / rowseq) + 'px,  white ' + eval(y1 + eval('' + s1rect.height) / rowseq) + 'px, white)'; 
}

function gcbr() { 
        var topbit='';
        if (('' + location.hash).indexOf('contents=') != -1 || bc != '') {
        //alert(document.URL);
        //alert(bc);
        //alert(('' + location.hash));
        //alert(('' + top.document.getElementById('demail').innerHTML));
           if (window.opener) {
             if (window.opener.document.getElementById('aemail')) {
               //alert('yes');
               if (window.opener.getaconto() != null) {
               //alert('Yes');
                  window.opener.getaconto().body.style.cursor='pointer';
               }
               window.opener.document.body.style.cursor='pointer';
               topbit=window.opener.document.getElementById('aemail').href.split('body=')[1];
               //alert('Topbit=' + topbit);
               //window.opener.close();
             }
           }
           if (window.top && topbit == '') {
             if (top.document.getElementById('aemail')) {
               topbit=top.document.getElementById('aemail').href.split('body=')[1];
               //alert('topbit=' + topbit);
               if (window.top.getaconto() != null) {
               //alert('Yes');
                  window.top.getaconto().body.style.cursor='pointer';
               }
               top.document.body.style.cursor='pointer';
             }
           }
        //alert(('' + window.opener.document.getElementById('demail').innerHTML));
           if (topbit != '') {
           document.getElementById('aemail').href+=topbit;
           document.getElementById('asms').href+=topbit;
           } else {
           document.getElementById('aemail').href+=encodeURIComponent(document.URL.split('#')[0] + ('' + location.hash).replace(/^null/g,'').replace('#contents=','&contents='));
           document.getElementById('asms').href+=encodeURIComponent(document.URL.split('#')[0] + ('' + location.hash).replace(/^null/g,'').replace('#contents=','&contents='));
           }
           document.getElementById('aemail').style.display='inline-block';
           document.getElementById('asms').style.display='inline-block';
           document.getElementById('demail').style.display='inline-block';
           document.getElementById('dsms').style.display='inline-block';
        }
        if (('' + location.hash).indexOf('&contents=') > 0 && bc == '') {
        //alert('Bc  =  ' + bc + ' ' + document.URL);
        bc='' + decodeURIComponent(('' + location.hash).split('&contents=')[0]);
      document.getElementById('ihid').value='' + decodeURIComponent(('' + location.hash).split('&contents=')[0]);
      document.getElementById('ihid').name='browsecontents';
        }
        if (document.getElementById('mysub').outerHTML.toLowerCase().indexOf('none;') == -1) {
          document.getElementById('dfirstth').innerHTML=document.getElementById('mysub').outerHTML.replace('mysub','mytwosub').replace('Validate','Validate a Change Below ...').replace('>', ' disabled>');
        }
  if (rowseq != '') {
   s1rect=s1.getBoundingClientRect();
   s1.onclick=function(event) { s1click(event);  };
   s1.ondblclick=function(event) { alert('Line ' + s1.title + s1.getAttribute('data-status') + ':' + String.fromCharCode(10) + s2.title);  };
   s2rect=s2.getBoundingClientRect();
   s2.onclick=function(event) { s2click(event);  };
   s2.ondblclick=function(event) { alert('Line ' + s1.title + s1.getAttribute('data-status') + ':' + String.fromCharCode(10) + s2.title);  };
  } 
  
  var tf=document.getElementById('outgoing').value;
  tfis=tf.split(':')[0];
  if (('' + location.hash).replace(/^null/g,'').replace(/^undefined/g,'').trim() != '' || bc != '') {
   if (document.getElementById('myhxfile').value == '') {
     if (bc != '') {
     document.getElementById('myhxfile').placeholder=bc;
     } else {
     document.getElementById('ihid').value='' + decodeURIComponent(('' + location.hash).replace(/^\#/g,'')).split('&')[0].split('#')[0];
     document.getElementById('ihid').name='browsecontents';
     document.getElementById('myhxfile').placeholder=decodeURIComponent(('' + location.hash).replace(/^\#/g,'')).split('&')[0].split('#')[0];
     }
     if (tfis.trim() != '') {
       while (tf.indexOf(tfis + ':') != -1) {
     if (bc != '') {
         tf=tf.replace(tfis + ':', bc + ':');
     } else {
         tf=tf.replace(tfis + ':', decodeURIComponent(('' + location.hash).replace(/^\#/g,'')).split('&')[0].split('#')[0] + ':');
     }
       }
       tfis=tf.split(':')[0];
       document.getElementById('outgoing').value=tf;
     }
   }
  }
  
  setTimeout(function() {
  if (preclientcontents != '') {
   document.getElementById('preincoming').value=preclientcontents;
   document.getElementById('preincoming').rows='' + preclientcontents.split(String.fromCharCode(10)).length;
   document.getElementById('preincoming').cols='' + '5';
  }
  if (clientcontents != '') {
   document.getElementById('incoming').value=clientcontents;
   document.getElementById('incoming').rows='' + preclientcontents.split(String.fromCharCode(10)).length;
   preclientcontents='';
   clientcontents='';
   var urlis=document.URL.split('?')[0].split('#')[0];
   if (('' + document.getElementById('myform').action).indexOf('#') != -1) {
     //alert('?#' + ('' + document.getElementById('myform').action).split('#')[1]);
     urlis+='?browsecontents=' + encodeURIComponent(('' + document.getElementById('myform').action).split('#')[1]) + '&' + document.getElementById('myhxfile').name + '=' + encodeURIComponent(document.getElementById('myhxfile').value.replace(/\#/g,'')) +  '#' + ('' + document.getElementById('myform').action).split('#')[1] + '&contents=' + encodeURIComponent(document.getElementById('incoming').value);
   } else {
  // alert('BC    = ' + bc);
     urlis+='?' + document.getElementById('myhxfile').name + '=' + encodeURIComponent(document.getElementById('myhxfile').value.replace(/\#/g,'')) +  '#contents=' + encodeURIComponent(document.getElementById('incoming').value);
   }
   if (1 == 6) {
   if (('' + document.getElementById('aemail').href).indexOf(encodeURIComponent('.php#')) != -1) {
if (('' + document.getElementById('myform').action).indexOf('#') != -1) {
   document.getElementById('demail').innerHTML='<a href="mailto:rmetcalfe15@gmail.com?subject=XML%20Lint&body=' + encodeURIComponent(urlis) + '">Email</a>';
} else {
   document.getElementById('demail').innerHTML='<a href="mailto:rmetcalfe15@gmail.com?subject=XML%20Lint&body=' + encodeURIComponent(urlis) + '">Email</a>';
}
   }
   }
        if (('' + location.hash).indexOf('&contents=') > 0) {
        //alert('Bc = ' + bc + ' ' + document.URL);
        bc='' + decodeURIComponent(('' + location.hash).split('&contents=')[0]);
      document.getElementById('ihid').value='' + decodeURIComponent(('' + location.hash).split('&contents=')[0]);
      document.getElementById('ihid').name='browsecontents';
        }
   setTimeout(function() {  
        //alert('Bc=' + bc + ' ' + document.URL); 
        if (('' + location.hash).indexOf('&contents=') > 0) {
        //alert('Bc=' + bc + ' ' + document.URL);
        bc='' + decodeURIComponent(('' + location.hash).split('&contents=')[0]);
      document.getElementById('ihid').value='' + decodeURIComponent(('' + location.hash).split('&contents=')[0]);
      document.getElementById('ihid').name='browsecontents';
        }
        document.getElementById('mysub').click(); 
   }, 8000); // 20000
  }
  }, 5000);
}

 function prereverseengineer() {
   var wasreng=reng;
   reng='';
   reverseengineer(wasreng);
 }

 function reverseengineer(what) {
       var oury2=0, nexty2=0;
  //if (!s2rect) { alert('Why ... ' + rowseq); } else { document.title='' + rowseq;   }
       if (!s2rect) { 
         s1 = paconto.getElementById('preincoming'); 
         s2 = paconto.getElementById('incoming'); 
         s1.addEventListener('scroll', select_scroll_1, false); 
         s2.addEventListener('scroll', select_scroll_2, false); 
         gcbr(); 
         if (('' + rowseq) == '') {
           if (window.opener) {
             if (window.opener.document.getElementById('aemail')) {
               //alert('yes');
               rowseq='' + window.opener.getrowseq();
             }
           } else if (window.parent) {
               rowseq='' + parent.getrowseq();
           }  
           //document.title='' + rowseq;       
         }
  //if (!s2rect) { alert('why ... ' + rowseq); } else { document.title='' + rowseq;   }
       }
       var theheight=eval(eval('' + s2rect.height) / rowseq);
       var codelines=s2.value.split(String.fromCharCode(10));
       var errdetail='', ierr=0, linenum=0, nums=[];
       thergb=redrgb;
       var bimg='linear-gradient(to bottom, white, '; // ' white ' + y2 + 'px, ' + thergb + ' ' + y2 + 'px, ' + thergb + ' ' + eval(y2 + eval('' + s1rect.height) / rowseq) + 'px,  white ' + eval(y1 + eval('' + s1rect.height) / rowseq) + 'px, white)'; 
       var suff=', white)';

       if (what.trim() != '') {
         nums=what.split(',');
       }
       if (eval('' + nums.length) > 0) {
         window.scrollTo(0,0);
         s1.title='' + nums[0]; // + linenum;
         s2.title='' + codelines[eval(-1 + eval('' + nums[0]))];
         //alert(what);
         oury2=eval(eval(-1 + eval('' + nums[0])) * theheight);
         bimg+=' white ' + oury2 + 'px, ' + thergb + ' ' + oury2 + 'px, ' + thergb + ' ' + eval(oury2 + eval('' + s1rect.height) / rowseq) + 'px, white ' + eval(oury2 + eval('' + s1rect.height) / rowseq) + 'px, ';
         for (ierr=1; ierr<nums.length; ierr++) {
         oury2=eval(eval(-1 + eval('' + nums[ierr])) * theheight);
         //bimg+=thergb + ' ' + eval(oury2 + eval('' + s1rect.height) / rowseq) + 'px, white ' + oury2 + 'px, ' + thergb + ' ' + oury2 + 'px, '; // + thergb + ' ' + eval(oury2 + eval('' + s1rect.height) / rowseq) + 'px, ';
         bimg+=' white ' + oury2 + 'px, ' + thergb + ' ' + oury2 + 'px, ' + thergb + ' ' + eval(oury2 + eval('' + s1rect.height) / rowseq) + 'px, white ' + eval(oury2 + eval('' + s1rect.height) / rowseq) + 'px, ';
         s1.title+=String.fromCharCode(10) + '' + nums[ierr]; // + linenum;
         s2.title+=String.fromCharCode(10) + '' + codelines[eval(-1 + eval('' + nums[ierr]))];
         }
         if (bimg.indexOf(suff) == -1) { bimg+=suff.substring(1); }
         //alert(bimg);
         // linear-gradient(to bottom, white, white 27.002228274325326px, rgba(255,0,0,0.2) 27.002228274325326px, rgba(255,0,0,0.2) 36.00297103243377px,  white 288.02376825947016px, rgba(255,0,0,0.2) 288.02376825947016px, rgba(255,0,0,0.2) 297.0245110175786px,  white 3015.248823966328px, rgba(255,0,0,0.2) 3015.248823966328px, rgba(255,0,0,0.2) 3024.2495667244366px,  white 3033.250309482545px, rgba(255,0,0,0.2) 3033.250309482545px, rgba(255,0,0,0.2) 3042.2510522406537px,  white)
         // vs //
         // linear-gradient(to bottom, white, white 17.825923805397395px, rgba(255,0,0,0.2) 17.825923805397395px, rgba(255,0,0,0.2) 26.82666656350584px,  white 26.82666656350584px, white)
         // VS //
         // linear-gradient(to bottom, white, white 27.002228274325326px, rgba(255,0,0,0.2) 27.002228274325326px, rgba(255,0,0,0.2) 297.0245110175786px, white 288.02376825947016px, rgba(255,0,0,0.2) 288.02376825947016px, rgba(255,0,0,0.2) 3024.2495667244366px, white 3015.248823966328px, rgba(255,0,0,0.2) 3015.248823966328px, rgba(255,0,0,0.2) 3042.2510522406537px, white 3033.250309482545px, rgba(255,0,0,0.2) 3033.250309482545px,  white)
         // Vs //
         // linear-gradient(to bottom, white,  white 27.002228274325326px, rgba(255,0,0,0.2) 27.002228274325326px, rgba(255,0,0,0.2) 36.00297103243377px, white 36.00297103243377px,  white 288.02376825947016px, rgba(255,0,0,0.2) 288.02376825947016px, rgba(255,0,0,0.2) 297.0245110175786px, white 297.0245110175786px,  white 3015.248823966328px, rgba(255,0,0,0.2) 3015.248823966328px, rgba(255,0,0,0.2) 3024.2495667244366px, white 3024.2495667244366px,  white 3033.250309482545px, rgba(255,0,0,0.2) 3033.250309482545px, rgba(255,0,0,0.2) 3042.2510522406537px, white 3042.2510522406537px,  white)
         s1.style.backgroundImage='' + bimg;
         s2.style.backgroundImage='' + bimg;
         document.getElementById('outgoing').title='Highlighted to left are codelines ' + what + ' with errors';
       }
 }

 function decorateleft() {
       var jerr=0;
       reng=''
       if (ourdelim == ':') {
         for (jerr=1; jerr<ourfindsare.length; jerr++) {
           if (ourfindsare[jerr].trim() != '') {
             if (ourfindsare[jerr].substring(0,1) >= '0' && ourfindsare[jerr].substring(0,1) <= '9') {
              if (ourfindsare[jerr].slice(-1) >= '0' && ourfindsare[jerr].slice(-1) <= '9') {
               if ((',' + reng + ',').indexOf(',' + ourfindsare[jerr].split(':')[0] + ',') == -1) {
               if (reng == '') { reng=ourfindsare[jerr]; } else {  reng+=',' + ourfindsare[jerr]; }
               }
              }
             }
           }
         }
       } else if (ourdelim.trim() != '') {
         for (jerr=1; jerr<ourfindsare.length; jerr++) {
           if (ourfindsare[jerr].split(':')[0].trim() != '') {
             if (ourfindsare[jerr].split(':')[0].substring(0,1) >= '0' && ourfindsare[jerr].split(':')[0].substring(0,1) <= '9') {
              if (ourfindsare[jerr].split(':')[0].slice(-1) >= '0' && ourfindsare[jerr].split(':')[0].slice(-1) <= '9') {
               if ((',' + reng + ',').indexOf(',' + ourfindsare[jerr].split(':')[0] + ',') == -1) {
               if (reng == '') { reng=ourfindsare[jerr].split(':')[0]; } else {  reng+=',' + ourfindsare[jerr].split(':')[0]; }
               }
              }
             }
           }
         }
       }
       if (reng != '') {
       setTimeout(prereverseengineer, 9000); // reverseengineer(reng);
       }
 }

 function handleSelection() { // thanks to https://stackoverflow.com/questions/46651479/reacting-to-selection-changes-in-an-html-textarea
  const activeElement = document.activeElement;

  // Make sure this is your textarea
  //document.title=(('' + activeElement.id) + activeElement.outerHTML.substring(0,23));
  if (activeElement && activeElement.outerHTML.indexOf('<textarea') == 0 && ('' + activeElement.id) == 'outgoing') {
  //if (paconto) {
  //alert('Here');
  //}
    const range = {
      start: activeElement.selectionStart,
      end: activeElement.selectionEnd
    };
    ourdelim=':';
    ourfindsare=[];
    thesel='';
    // Do something with your range
    if (eval('' + range.end) > eval('' + range.start)) {
      thesel=(activeElement.value.substring(range.start).substring(0, eval(eval('' + range.end) - eval('' + range.start) )));
      if (thesel.trim() != '' && thesel.indexOf(':') != -1) {
      var floc=thesel.split(':')[0];
      if (tfis != '') {
        if (eval('' + floc.length) >= eval('' + tfis.length)) {
          ourdelim=tfis + ':';
          ourfindsare=thesel.split(ourdelim);
        } else {
          thesel=thesel.replace(':', tfis + ':');
          ourdelim=tfis + ':';
          ourfindsare=thesel.split(ourdelim);
        }
      } else {
          ourfindsare=thesel.split(ourdelim);
      }
      decorateleft();
      }
    }
  }
 }

 function phandleSelection() { // thanks to https://stackoverflow.com/questions/46651479/reacting-to-selection-changes-in-an-html-textarea
  const pactiveElement = paconto.activeElement;

  // Make sure this is your textarea
  //document.title=(('' + activeElement.id) + activeElement.outerHTML.substring(0,23));
  if (pactiveElement && pactiveElement.outerHTML.indexOf('<textarea') == 0 && ('' + pactiveElement.id) == 'outgoing') {
  //if (paconto) {
  //alert('Here');
  //}
    const prange = {
      start: pactiveElement.selectionStart,
      end: pactiveElement.selectionEnd
    };
    ourdelim=':';
    ourfindsare=[];
    thesel='';
    // Do something with your range
    if (eval('' + prange.end) > eval('' + prange.start)) {
      thesel=(pactiveElement.value.substring(prange.start).substring(0, eval(eval('' + prange.end) - eval('' + prange.start) )));
      if (thesel.trim() != '' && thesel.indexOf(':') != -1) {
      var floc=thesel.split(':')[0];
      if (tfis != '') {
        if (eval('' + floc.length) >= eval('' + tfis.length)) {
          ourdelim=tfis + ':';
          ourfindsare=thesel.split(ourdelim);
        } else {
          thesel=thesel.replace(':', tfis + ':');
          ourdelim=tfis + ':';
          ourfindsare=thesel.split(ourdelim);
        }
      } else {
          ourfindsare=thesel.split(ourdelim);
      }
      decorateleft();
      }
    }
  }
 }
 
 function dohash(isfort) {
 //alert('' + isfort);
   if (!isfort || 8 == 8) {
     var urlis=document.URL.split('?')[0].split('#')[0];
     if (('' + document.getElementById('myform').action).indexOf('#') != -1) {
     //alert('#' + ('' + document.getElementById('myform').action).split('#')[1]);
     document.getElementById('ihid').value='' + ('' + document.getElementById('myform').action).split('#')[1];
     document.getElementById('ihid').name='browsecontents';
     urlis+='?browsecontents=' + encodeURIComponent(('' + document.getElementById('myform').action).split('#')[1]) + '&' + document.getElementById('myhxfile').name + '=' + encodeURIComponent(document.getElementById('myhxfile').value.replace(/\#/g,'')) +  '#' + ('' + document.getElementById('myform').action).split('#')[1] + '&contents=' + encodeURIComponent(document.getElementById('incoming').value);
     } else {
   //alert('bC    = ' + bc);
     urlis+='?' + document.getElementById('myhxfile').name + '=' + encodeURIComponent(document.getElementById('myhxfile').value.replace(/\#/g,'')) +  '#contents=' + encodeURIComponent(document.getElementById('incoming').value);
     }
//alert(urlis);
     if (!window.opener || ('' + document.referrer) == '') {
     //alert('dref=' + document.referrer + ' urlis=' + urlis);
     document.body.style.cursor='progress';
     woois=window.open(urlis, '_blank');
     } //else {
     //alert('top' + document.referrer);
     //}
     if (1 == 1) {
     document.getElementById('myform').target='myif';
     ihsms=document.getElementById('dsms').innerHTML;
     ihemail=document.getElementById('demail').innerHTML;
     document.getElementById('myif').style.position='absolute';
     document.getElementById('myif').style.top='0px';
     document.getElementById('myif').style.left='0px';
     document.getElementById('myif').style.width='100%';
     document.getElementById('myif').style.height='100%';
     document.getElementById('myif').style.zIndex='100';
     document.getElementById('myif').style.display='block';
     return true;
     } else {
     location.href=urlis;
     }
     return isfort; //false;
   }
   //alert(87);
   return true;
 }
 
 function doemail() {
 }
 
 function dosms() {
   if (document.getElementById('asms').href.indexOf('sms:&') != -1) {
     document.getElementById('asms').href=document.getElementById('asms').href.replace('sms:&', 'sms:' + ('' + prompt('Please enter SMS number', '')).replace(/^null/g,'') + '&');
     if (document.getElementById('asms').href.indexOf('sms:&') == -1) {
       document.getElementById('asms').click();
     }
   }
 }
 
 function checkmyif(iois) {
  if (iois != null) {
    paconto = (iois.contentWindow || iois.contentDocument);
    if (paconto != null) {
     if (paconto.document) { paconto = paconto.document; }
     if (paconto.body != null && (iois.src.indexOf('?') != -1 || iois.src.indexOf('#') != -1 || ihemail != '')) {
 paconto.addEventListener('selectionchange', phandleSelection);
     
       if (('' + document.referrer) == '') {
         paconto.body.style.cursor='progress';
       }
       if (document.getElementById('demail')) {
       //alert(document.getElementById('demail').innerHTML);
         if (('' + document.referrer) == '') {
           paconto.body.style.cursor='progress';
         }
         if (paconto.getElementById('demail')) {
         if (ihemail != '') {
         paconto.getElementById('demail').innerHTML=ihemail;
         } else {
         paconto.getElementById('demail').innerHTML=document.getElementById('demail').innerHTML;
         }
         paconto.getElementById('demail').style.display='inline-block';
         }
       }
       if (document.getElementById('dsms')) {
         if (paconto.getElementById('dsms')) {
         if (ihsms != '') {
         paconto.getElementById('dsms').innerHTML=ihsms;
         } else {
         paconto.getElementById('dsms').innerHTML=document.getElementById('dsms').innerHTML;
         }
         paconto.getElementById('dsms').style.display='inline-block';
         }
       }
     }
    }
  }
 }
 
 function maybeshow() {
   if (document.getElementById('incoming').value != '') {
      var wwoo=window.open('','_blank','top=50,left=50,width=900,height=900');
      if (document.getElementById('myhxfile').value != '') {
      wwoo.document.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>' + document.getElementById('myhxfile').value + '</title></head><body><textarea style=width:100%;height:100%;>' + document.getElementById('incoming').value + '</textarea></body></html>');
      } else if (document.getElementById('myhxfile').placeholder.indexOf('Please ') == -1) {
      wwoo.document.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>' + document.getElementById('myhxfile').placeholder + '</title></head><body><textarea style=width:100%;height:100%;>' + document.getElementById('incoming').value + '</textarea></body></html>');
      } else {
      wwoo.document.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>XML Lint Validation incoming XML or HTML</title></head><body><textarea style=width:100%;height:100%;>' + document.getElementById('incoming').value + '</textarea></body></html>');
      }
   }
 }

 document.addEventListener('selectionchange', handleSelection);

setInterval(ronecheck, 3000);
</script>
</head>
<body style=background-color:rgb(250,250,250); onload="s1 = document.getElementById('preincoming'); s2 = document.getElementById('incoming'); s1.addEventListener('scroll', select_scroll_1, false); s2.addEventListener('scroll', select_scroll_2, false); gcbr(); " data-onload='onl();'>
<h1>XML Lint Validation&nbsp;<div id=demail style=display:none;><a onclick=doemail(); id=aemail href="mailto:?subject=XML%20Lint&body=">&#128231;</a></div>&nbsp;<div id=dsms style=display:none;><a onclick=dosms(); id=asms href="sms:&body=">&#128223;</a></div></h1>
<h3>RJM Programming - June, 2024</h3>
<form accept-charset="UTF-8" onsubmit=" if (document.getElementById('myhxfile').value == '') { document.getElementById('myhxfile').name='xx';  }  return dohash(true);" action=./xmllint_validation.php<?php echo $bc; ?> id=myform method=POST target=_self><input type=hidden id=ihid value=''></input>
<table style=width:95%;background-color:rgba(200,200,200,0.5); border=5>
<tr><th colspan=2 style=display:table-cell;overflow-y:hidden;text-align:center;><span style=vertical-align:top;margin-top:10px;display:inline-block;>XML Lint validation of</span>&nbsp;<input title='If textarea below populated a double click here can open that content fully.' ondblclick="maybeshow();" style=width:50%;vertical-align:top;margin-top:10px; onblur="if (this.value.length > 0) {  document.getElementById('mysub').click();  }" name=htmlfile id=myhxfile placeholder="<?php echo str_replace('>','&gt;',str_replace('<','&lt;',$prefn)); ?>" value=""></input>&nbsp;<span id=scbi style=background-color:yellow;><iframe onload=pcheckit(this); scrolling=no frameborder=0 id=cbi data-type=file data-accept="text/html" style="border-left:2px solid yellow;background-color:yellow;z-index:1;display:inline-block;width:173px;height:228px;margin-top:-194px;" src="/HTMLCSS/client_browsing.htm?d=691075196224842271&straighttext=y"></iframe></span></th></tr>
<tr><th title='Click below makes codeline red when has errors, else green.  Double click shows the full codeline as relevant.' id=firstth>Data to validate&nbsp;<div style=display:inline-block; id=dfirstth></div></th><th title='Highlight error reporting of interest that will cause left hand textarea highlighting of these relevant codelines.  Then hover to left to show complete relevant codeline(s).'>XML Lint results</th></tr>
<tr><td style=vertical-align:top;><textarea<?php echo $rowseq; ?><?php echo $colseq; ?> data-status='' style=font-size:8px;display:inline-block;overflow-x:clip;text-wrap:nowrap;text-align:right; id=preincoming><?php echo str_replace('>','&gt;',str_replace('<','&lt;',$precontents)); ?></textarea><textarea<?php echo $rowseq; ?> onchange="if (document.getElementById('mytwosub')) { document.getElementById('mytwosub').disabled=false;   }" onblur="if (this.value.length > 0 && '<?echo $fn; ?>' == '') { alert('bC=' + bc); document.getElementById('mysub').click();  }" style=width:80%;font-size:8px;display:inline-block;overflow-x:clip;text-wrap:nowrap; name=content id=incoming><?php echo str_replace('>','&gt;',str_replace('<','&lt;',$contents)); ?></textarea></td><td style=vertical-align:top;><textarea<?php echo $rowseq; ?> style=width:100%; id=outgoing><?php echo str_replace('>','&gt;',str_replace('<','&lt;',$results)); ?></textarea></td></tr>
<tr><td></td><td id=lasttd><input type=submit id=mysub style=background-color:lightgreen;display:<?php echo $vsnone; ?> value=Validate></input></td></tr>
</table>
</form>
<div id=txtresultout></div>
<div id=resultout></div>
<div id=result></div>
<textarea style=display:none; id=result1></textarea>
<textarea style=display:none; id=result2></textarea>
<!--div id=resultav></div-->
<textarea style=display:none; id=thewords></textarea>
<input id=outputname type=hidden value=''></input>
<input id=cto type=hidden value=''></input>
<div id=dstyle></div>
<iframe onload=checkmyif(this); id=myif name=myif style=display:none; src='./xmllint_validation.php'></iframe> 
</body>
</html>
