links:
// This is the script generating the links list, just alter the
// $category variable (click links) to sort links by category.
//
// Or browse the site manually using apache browsing.
//
// Camille Harang <mammique@garbure.org>
$category = $_GET['category'];

$content = new DOMDocument();
$content->load('content.xml');

$cv = $content->getElementsByTagName('curriculum_vitae');
$cv = $cv->item(0);

$entries = $cv->getElementsByTagName('entry');
foreach ($entries as $entry) {

  $entry_path = $entry->firstChild->nodeValue;

  switch ($category) {

  case 'plastic':
    if ($entry->parentNode->getAttribute('name') == 'plastic')
      $links[] = $entry_path; break;

  case 'soft':
    if ($entry->parentNode->getAttribute('name') == 'soft')
      $links[] = $entry_path; break;

  case 'doc':
    if ($entry->parentNode->getAttribute('name') == 'doc')
      $links[] = $entry_path; break;

  case 'other':
    if ($entry->parentNode->getAttribute('name') == 'other')
      $links[] = $entry_path; break;

  default:
    $links[] = $entry_path; break;
  }
}

sort($links);
$links = array_unique($links);

foreach ($links as $link)
  echo '<li><a href="'.$link.'">'.$link."</a></li>\n";
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike2.5 License.