xref: /PHP-5.3/ext/xsl/tests/xslt012.phpt (revision 1504c700)
1--TEST--
2Test 12: Using Associative Array of Parameters
3--SKIPIF--
4<?php require_once dirname(__FILE__) .'/skipif.inc'; ?>
5--FILE--
6<?php
7echo "Test 12: Using Associative Array of Parameters";
8
9$dom = new domDocument;
10$dom->load(dirname(__FILE__)."/xslt.xml");
11if(!$dom) {
12  echo "Error while parsing the document\n";
13  exit;
14}
15
16$xsl = new domDocument;
17$xsl->load(dirname(__FILE__)."/xslt012.xsl");
18if(!$xsl) {
19  echo "Error while parsing the document\n";
20  exit;
21}
22
23$proc = new xsltprocessor;
24if(!$proc) {
25  echo "Error while making xsltprocessor object\n";
26  exit;
27}
28
29
30$proc->importStylesheet($xsl);
31
32$parameters = Array(
33					'foo' => 'barbar',
34					'foo1' => 'test',
35					);
36
37$proc->setParameter( "", $parameters);
38
39print "\n";
40print $proc->transformToXml($dom);
41print "\n";
42
43
44--EXPECT--
45Test 12: Using Associative Array of Parameters
46<?xml version="1.0" encoding="iso-8859-1"?>
47<html><body>barbar
48test
49a1 b1 c1 <br/>
50a2 c2 <br/>
51�3 b3 c3 <br/>
52</body></html>
53