Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
// Xml and XSL files
$xml_file = "./sections/sitedata.xml";
$xsl_file = "./sections/".$page.".xsl";
//Check for Extra Parameters
$xtra = "A Value;"
/* you can also give multiple by changing $xtra into $xtra = array("name" => "value", "name2" => "value2"); then changing out the array('xtra' => $xtra) to just $xtra. */
// Allocate a new XSLT processor
$xh = xslt_create();
$fileBase = 'file://' . getcwd () . '/';
xslt_set_base ( $xh, $fileBase );
// Process the document
$result = xslt_process($xh, $xml_file, $xsl_file, NULL, array(), array('xtra' => $xtra));
if (!$result) {
// Something croaked. Show the error
echo 'XSLT processing error: ' .xslt_error($xh) ;
}
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xsl:space="preserve">
<xsl:param name="xtra"/>
<xsl:template match="/">
<xsl:apply-templates select="sitedata" />
</xsl:template>
....
<xsl:value-of select="xtra" />
<xsl:value-of select="$xtra" />
<xsl:template match="tutorial">
<xsl:if test="./@id=$xtra">
....
OUTPUT for this tutorial
....
</xsl:if>
</xsl:template>