xslt004.phpt 641 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. Test 4: Checking UTF8 Output
  3. --SKIPIF--
  4. <?php require_once dirname(__FILE__) .'/skipif.inc'; ?>
  5. --FILE--
  6. <?php
  7. echo "Test 4: Checking UTF8 Output";
  8. include("prepare.inc");
  9. $xp = new domxpath($xsl);
  10. $res = $xp->query("/xsl:stylesheet/xsl:output/@encoding");
  11. if ($res->length != 1) {
  12. print "No or more than one xsl:output/@encoding found";
  13. exit;
  14. }
  15. $res->item(0)->value = "utf-8";
  16. $proc->importStylesheet($xsl);
  17. print "\n";
  18. print $proc->transformToXml($dom);
  19. print "\n";
  20. --EXPECT--
  21. Test 4: Checking UTF8 Output
  22. <?xml version="1.0" encoding="utf-8"?>
  23. <html><body>bar
  24. a1 b1 c1 <br/>
  25. a2 c2 <br/>
  26. ä3 b3 c3 <br/>
  27. </body></html>