File: xsltest.php

package info (click to toggle)
phpreports 0.3.6-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 620 kB
  • ctags: 1,149
  • sloc: php: 2,668; xml: 157; makefile: 29; python: 10; sh: 2
file content (20 lines) | stat: -rwxr-xr-x 502 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
	if(intval(substr(phpversion(),0,1)<5)){
		print "THIS IS AN ERROR MESSAGE!!!\n";
		print "XSL support are only ok with PHP5.\n";
		print "Please use Sablotron with PHP < 5\n";
		print "Aborting script ...\n";
		return;
	}

	$oXML = new DomDocument();
	$oXML->load("../xsltest.xml");

	$oXSL = new DomDocument();
	$oXSL->load("../xslt/xsltest.xsl");

	$oProc = new XSLTProcessor();
	$oProc->importStyleSheet($oXSL);
	$oProc->setParameter("","html","ok");
	print $oProc->transformToXML($oXML);
?>