#!/bin/sh

# Run in proj/script directory
function test01
{
  pushd ..

  tempfile=/tmp/ie93902.txt
  echo "" > ${tempfile}

  local i
  find . -name "*.xml" >> ${tempfile}
  find . -name "*.html" >> ${tempfile}
  find . -name "*.xhtml" >> ${tempfile}


  for i in `cat ${tempfile} | grep -v "./ce/" | grep -v "./p1/misc/proj/html/" | grep -v "./p1/comsci/doxygen/html/" | sort`; do
    echo $i;
  done

  popd
}

# Print negative results after/during validatefiles call.
function validatefilesneg
{
  validateresultsneg=/tmp/validatenegresults.txt
  cat ${validateresultsneg}
}

# Print out the tests which fail.
function validatefiles
{
  tempfile=/tmp/validatehtmltemp82.txt
  echo "" > ${tempfile}

  validateresultspos=/tmp/validateposresults.txt
  validateresultsneg=/tmp/validatenegresults.txt

  echo "Validate Positive Results" > ${validateresultspos}
  echo "Validate Negative Results" > ${validateresultsneg}

  local i
  find . -name "*.xml" >> ${tempfile}
  find . -name "*.html" >> ${tempfile}
  find . -name "*.xhtml" >> ${tempfile}

  for i in `cat ${tempfile} | grep -v "html/"`; do
    validate $i;
    if [ "$?" == "0" ]; then
      echo $i >> ${validateresultspos};
    else
      echo $i >> ${validateresultsneg};
    fi
    
  done

  cat ${validateresultsneg}
}


# Develop script to tests for html validity.
# test01


