Xtract project information

Ceci est un test de Xtract pour la gestion des projets Staf-18. Pour Xtract, il existe un petit tutoriel. Notez que vous pouvez bookmarker les queries effectués (on utilise un GET).

Note: Pour le moment, il n'existe pas de XML Query Language "officiel". Xtract fait penser à XSLT et il est basé sur la proposition "XQL". Voir aussi la SQL FAQ.. Le débat est ouvert .... Voir par exemple XML_QL qui est très différent de Xtract.

Alternative a Xtract: GMD-IPSI XQL Engine (plus sophistiqué).


" ", "teacher-comment" => "

Teacher Comment

", "title" => "", "list" => "", "item" => "" ); function startElement($parser, $name, $attrs) { global $begin_array; if ($htmlexpr = $begin_array[$name]) { print "$htmlexpr"; } else { print "

$name:"; } if ($name != "list") { // --- print attributes while (list ($attr, $content) = each ($attrs)){ echo "$attr = $content\n"; } echo "

"; } } function endElement($parser, $name) { global $end_array; if ($htmlexpr = $end_array[$name]) { print "$htmlexpr"; } else { // un paragraphe pour etre sur print "

"; } } function characterData($parser, $data) { // echo "

\n";
  echo "$data \n";
  // echo "
\n"; } // process a file function process_file ($file) { global $project_dir; global $cmd_1; global $xml_servlet; global $style_sheet; $file_path = $project_dir . $file; $cmd = $cmd_1 . $file_path; // echo "

DEBUG: cmd = $cmd

\n"; // echo "

DEBUG: Status = $status

\n"; $url = $xml_servlet . "?xml=" . $file_path . "&xsl=" . $style_sheet; $url_ref = "$file"; $toc_ref = " [top]"; echo "\n


Query Results for file $url_ref $toc_ref

\n" ; // init XML Parser $xml_parser = xml_parser_create("ISO-8859-1"); xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, false); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); exec ($cmd, $xtract_output, $status); // We have to wrap each xtract_output into some xml tag, else the parser // will freak out. xml_parse($xml_parser, "", 0); // input xtract_output to xml_parser while ( list ($junk, $data) = each ($xtract_output) ) { // echo "\n
DEBUG: data = $data
\n"; // echo "\nDEBUG: feof(fp) = " . feof($fp); if (!xml_parse($xml_parser, $data, 0)) { die(sprintf( "XML error: %s at line %d, column %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser), xml_get_current_column_number($xml_parser) )); } } // tell the parser that we are done xml_parse($xml_parser, "
", 1); // free parser xml_parser_free($xml_parser); } // -------------------- table of contents function print_toc_el ($file) { echo "
  • "; echo "$file\n"; echo "
  • \n"; } function make_toc ($files) { echo "

    Project File List:

    \n"; echo "\n"; } function make_file_option($file) { echo "