xml - How can i link an xsl page into my php page? -



xml - How can i link an xsl page into my php page? -

i have xml page includes php in it, hence called xml.php

i have created xsl style sheet style xml.php page

however need link xsl page php page. cannot use

"<?xml-stylesheet type="text/xsl" href="xslt.xsl"?>

because page .php?? thanks

<?php // load xml source $xml = new domdocument; $xml->load('collection.xml'); $xsl = new domdocument; $xsl->load('collection.xsl'); // configure transformer $proc = new xsltprocessor; $proc->importstylesheet($xsl); // attach xsl rules echo $proc->transformtoxml($xml); ?>

php xml xslt

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -