00001 <?php 00002 00003 include "include/inc.header.php"; 00004 00005 $xml = "<Test>content</Test>"; 00006 00007 $dom = domxml_open_mem($xml); 00008 00009 // xml tests 00010 $xpc = xpath_new_context($dom); 00011 $path = "//Test"; 00012 $res = & xpath_eval($xpc, $path); 00013 for($i = 0; $i < count($res->nodeset); $i++) 00014 { 00015 $node = $res->nodeset[$i]; 00016 $node->set_content(htmlentities("foo&bar<b a=\"10\">hh</b>")); 00017 } 00018 00019 $xml = $dom->dump_mem(0, "UTF-8"); 00020 00021 // xsl tests 00022 $xsl = file_get_contents("xmlcompliancetest.xsl"); 00023 //$xsl = file_get_contents("content/page.xsl"); 00024 $args = array( '/_xml' => $xml, '/_xsl' => $xsl ); 00025 $xh = xslt_create(); 00026 $params = array(); 00027 $output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args, $params); 00028 00029 echo htmlentities($output); 00030 ?>