I have 3 pages
Page 1 is php to process & display xml (via sablotron)
Page 2 is xml - contains the data
Page 3 is the xsl file for style
How do I load one record from the XML file
via a dynamic url variable ?
ie. geo_area.php?record=33
the code I have for loading the xml + xsl in php
is this:
<?php
function LoadPageContent($wFile,$wStyle){
# create XSLT processor
$xsltProcessor = xslt_create ();
# generate filebase from working directory
$fileBase = 'file://' . getcwd () . '/';
# process the 'sample.xml' and 'sample.xsl' files
$result = xslt_process ($xsltProcessor, $fileBase . "xml/" . $wFile .'.xml', $fileBase . "xml/" . $wStyle . '.xsl');
# print the result
if ( $result ) {
echo $result; //htmlentities ( $result );
} else {
echo 'Fail due to error: '.xslt_error($xsltProcessor);
}
# free the processor resource
xslt_free ( $xsltProcessor );
}
?>
anyone have samples or good demos ?
thanks!
Page 1 is php to process & display xml (via sablotron)
Page 2 is xml - contains the data
Page 3 is the xsl file for style
How do I load one record from the XML file
via a dynamic url variable ?
ie. geo_area.php?record=33
the code I have for loading the xml + xsl in php
is this:
<?php
function LoadPageContent($wFile,$wStyle){
# create XSLT processor
$xsltProcessor = xslt_create ();
# generate filebase from working directory
$fileBase = 'file://' . getcwd () . '/';
# process the 'sample.xml' and 'sample.xsl' files
$result = xslt_process ($xsltProcessor, $fileBase . "xml/" . $wFile .'.xml', $fileBase . "xml/" . $wStyle . '.xsl');
# print the result
if ( $result ) {
echo $result; //htmlentities ( $result );
} else {
echo 'Fail due to error: '.xslt_error($xsltProcessor);
}
# free the processor resource
xslt_free ( $xsltProcessor );
}
?>
anyone have samples or good demos ?
thanks!