diff --git a/phpgwapi/doc/xml/xmltool_tester.php b/phpgwapi/doc/xml/xmltool_tester.php new file mode 100644 index 0000000000..374de344b5 --- /dev/null +++ b/phpgwapi/doc/xml/xmltool_tester.php @@ -0,0 +1,138 @@ +
\n"; +$nav = 'navigation: initial array | export_xml | import_xml | export_var | export_structprint_r(\$myarr);
\$myarr is the multi-dimensional array we which have defined in the file.\n";
+echo "note: notice the last element of the array is an object. xmltool will handle this as well\n";
+echo "\n"; +print_r($myarr); +echo "\n"; + +/* Now to auto-convert to an xmltool object */ +echo '
\n \$doc = new xmltool();
\n \$doc->import_var('myarr',\$myarr,True);
\n \$xml_result = \$doc->export_xml();
\n
\n \$doc = new xmltool();
\n \$xml_result = \$doc->import_var('myarr',\$myarr,True,true);
\n
\n \$xml_result = \$var2xml(\$myarr);
\n
\n"; +echo htmlentities($xml_result); +echo "\n"; + +echo '
\$doc = new xmltool();
\n \$doc->import_xml(\$xml_result);
\n
print_r(\$doc);
which shows the object tree\n";
+echo "\n"; +print_r($doc); +echo "\n"; + +$cnode = new xmltool('node','newnode'); +$cnode->import_var('blah',$myarr); +echo "
print_r(\$cnode);
which shows the object tree\n";
+echo "\n"; +print_r($cnode); +echo "\n"; + +//$doc->data->data[3]->import_xml($xml_result); +//$doc->data->data[3]->import_var('blah',$myarr); +$xml_result = $doc->export_xml(); + +echo '
\n"; +echo htmlentities($xml_result); +echo "\n"; + +echo '
\$result_array = \$doc->export_var();
\n
print_r(\$result_array);
\n";
+echo "\n"; +print_r($result_array); +echo "\n"; + +echo '
\$result_struct = \$doc->export_struct();
\n
print_r(\$result_struct);
\n";
+echo "\n"; +print_r($result_struct); +echo "\n"; +echo '