6 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
7 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-loose.dtd">
8 <html xmlns
="http://www.w3.org/1999/xhtml" xml
:lang
="en" lang
="en">
10 <title
>HTML Purifier Attribute Transformation Smoketest
</title
>
11 <meta http
-equiv
="Content-Type" content
="text/html; charset=UTF-8" />
12 <style type
="text/css">
13 div
.container
{position
:relative
;height
:120px
;border
:1px solid
#CCC;
14 margin
-bottom
:1em
; width
:225px
; float:left
; margin
-top
:1em
;
16 h2
{clear
:left
;margin
-bottom
:0;}
17 div
.container
.legend
.test
{text
-align
:center
;line
-height
:100px
;}
18 div
.test
{width
:100px
;height
:100px
;border
:1px solid black
;
19 position
:absolute
;top
:10px
;overflow
:auto
;}
20 div
.test
.html
{left
:10px
;border
-right
:none
;background
:#FCC;}
21 div
.test
.css
{left
:110px
;background
:#CFC;}
22 img
.marked
{border
:1px solid
#000;background:#FFF;}
23 table
.bright
{background
-color
:#F00;}
24 hr
.short
{width
:50px
;}
28 <h1
>HTML Purifier Attribute Transformation Smoketest
</h1
>
29 <div
class="container legend">
30 <div
class="test html">
33 <div
class="test css">
39 if (version_compare(PHP_VERSION
, '5', '<')) exit('<p>Requires PHP 5.</p>');
41 $xml = simplexml_load_file('attrTransform.xml');
43 // attr transform enabled HTML Purifier
44 $config = HTMLPurifier_Config
::createDefault();
45 $config->set('HTML.Doctype', 'XHTML 1.0 Strict');
46 $purifier = new HTMLPurifier($config);
48 $title = isset($_GET['title']) ?
$_GET['title'] : true;
50 foreach ($xml->group
as $group) {
51 echo '<h2>' . $group['title'] . '</h2>';
52 foreach ($group->sample
as $sample) {
53 $sample = (string) $sample;
55 <div
class="container">
56 <div
class="test html">
57 <?php
echo $sample; ?
>
59 <div
class="test css">
60 <?php
echo $purifier->purify($sample); ?
>