~ubuntu-branches/ubuntu/quantal/php5/quantal

« back to all changes in this revision

Viewing changes to ext/xsl/tests/xslt012.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Sean Finney
  • Date: 2009-07-01 09:12:10 UTC
  • mto: (0.9.1) (1.1.17 upstream)
  • mto: This revision was merged to the branch mainline in revision 58.
  • Revision ID: james.westby@ubuntu.com-20090701091210-go0h6506p62on17r
Tags: upstream-5.3.0
Import upstream version 5.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
Test 12: Using Associative Array of Parameters
 
3
--SKIPIF--
 
4
<?php require_once dirname(__FILE__) .'/skipif.inc'; ?>
 
5
--FILE--
 
6
<?php
 
7
echo "Test 12: Using Associative Array of Parameters";
 
8
 
 
9
$dom = new domDocument;
 
10
$dom->load(dirname(__FILE__)."/xslt.xml");
 
11
if(!$dom) {
 
12
  echo "Error while parsing the document\n";
 
13
  exit;
 
14
}
 
15
 
 
16
$xsl = new domDocument;
 
17
$xsl->load(dirname(__FILE__)."/xslt012.xsl");
 
18
if(!$xsl) {
 
19
  echo "Error while parsing the document\n";
 
20
  exit;
 
21
}
 
22
 
 
23
$proc = new xsltprocessor;
 
24
if(!$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
 
 
39
print "\n";
 
40
print $proc->transformToXml($dom);
 
41
print "\n";
 
42
 
 
43
 
 
44
--EXPECT--
 
45
Test 12: Using Associative Array of Parameters
 
46
<?xml version="1.0" encoding="iso-8859-1"?>
 
47
<html><body>barbar
 
48
test
 
49
a1 b1 c1 <br/> 
 
50
a2 c2 <br/> 
 
51
�3 b3 c3 <br/> 
 
52
</body></html>