/[cvs]/bareface/yakka/library/YakkaXslProcessor.php
ViewVC logotype

Contents of /bareface/yakka/library/YakkaXslProcessor.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Mon Jan 6 13:32:51 2003 UTC (21 years, 10 months ago) by bareface
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +2 -2 lines
now setting base file path to enable easy <xsl:includes> of other xsls;

1 <?php
2
3 require_once("YakkaXml.php");
4
5 class YakkaXslProcessor {
6 function YakkaXslProcessor() {
7 }
8
9 function process($source, $template, $baseDirectory = "") {
10 if (is_object($source) && $source->is("YakkaXml"))
11 $sourceXml = $source->toXml();
12 else
13 $sourceXml = $source;
14
15 if (is_object($template) && $template->is("YakkaXml"))
16 $templateXml = $template->toXml();
17 else
18 $templateXml = $template;
19
20 $xsltProcessor = xslt_create();
21 $xsltArguments = array(
22 "/_xml" => $sourceXml,
23 "/_xsl" => $templateXml
24 );
25
26 $xsltParameters = array();
27
28 xslt_set_base($xsltProcessor, "file://".$baseDirectory);
29 $resultXml = new YakkaXml(xslt_process($xsltProcessor, "arg:/_xml", "arg:/_xsl", null, $xsltArguments, $xsltParameters));
30 xslt_free($xsltProcessor);
31
32 return $resultXml;
33 }
34 }
35
36 ?>

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed