File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / xsl / tests / xslt012.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:05 2012 UTC (12 years, 4 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

    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>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>