Click to See Complete Forum and Search --> : XML-XSL parser


dennebom
10-28-2003, 09:32 AM
Hey,

I've made a simple php parser to parse xml and xsl into a nice webpage.



<?

// include variable's
include("CONST.php");


// Set location XML and XSL file
$XMLfile = "" . $DB_DIRECTORY . "/data.xml";
$XSLfile = "" . $XSL_DEFAULT_PATH . "/page.xsl";

// Load xml and xsl in DOM
$xmldoc = domxml_open_file($XMLfile);
$xsldoc = domxml_xslt_stylesheet_file($XSLfile);


// Parse XML and XSL
$result = $xsldoc->process($xmldoc);

// Show HTML file in browser
print $result->dump_mem();

?>


Let me know what you think.

LordShryku
10-28-2003, 11:59 AM
I think you should add a disclaimer

The DOM XML extension is considered experimental. It makes use of the Gnome XML Library, and you will at least need libxml-2.4.14 to use it. To use the XSL functions shown here, you will also need the libxslt library