File tree 1 file changed +4
-72
lines changed
1 file changed +4
-72
lines changed Original file line number Diff line number Diff line change @@ -6,80 +6,12 @@ if (!extension_loaded('xsl')) die("skip Extension XSL is required\n");
6
6
?>
7
7
--FILE--
8
8
<?php
9
-
10
- $ xsl = new DOMDocument ;
11
- $ xsl ->loadXML ('<html xsl:version="1.0"
12
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
13
- lang="en">
14
- <head>
15
- <title>Sales Results By Division</title>
16
- </head>
17
- <body>
18
- <table border="1">
19
- <tr>
20
- <th>Division</th>
21
- <th>Revenue</th>
22
- <th>Growth</th>
23
- <th>Bonus</th>
24
- </tr>
25
- <xsl:for-each select="sales/division">
26
- <!-- order the result by revenue -->
27
- <xsl:sort select="revenue"
28
- data-type="number"
29
- order="descending"/>
30
- <tr>
31
- <td>
32
- <em><xsl:value-of select="@id"/></em>
33
- </td>
34
- <td>
35
- <xsl:value-of select="revenue"/>
36
- </td>
37
- <td>
38
- <!-- highlight negative growth in red -->
39
- <xsl:if test="growth < 0">
40
- <xsl:attribute name="style">
41
- <xsl:text>color:red</xsl:text>
42
- </xsl:attribute>
43
- </xsl:if>
44
- <xsl:value-of select="growth"/>
45
- </td>
46
- <td>
47
- <xsl:value-of select="bonus"/>
48
- </td>
49
- </tr>
50
- </xsl:for-each>
51
- </table>
52
- </body>
53
- </html> ' );
54
-
55
- $ dom = new DOMDocument ;
56
- $ dom ->loadXMl ('<sales>
57
-
58
- <division id="North">
59
- <revenue>10</revenue>
60
- <growth>9</growth>
61
- <bonus>7</bonus>
62
- </division>
63
-
64
- <division id="South">
65
- <revenue>4</revenue>
66
- <growth>3</growth>
67
- <bonus>4</bonus>
68
- </division>
69
-
70
- <division id="West">
71
- <revenue>6</revenue>
72
- <growth>-1.5</growth>
73
- <bonus>2</bonus>
74
- </division>
75
-
76
- </sales> ' );
77
-
78
- $ proc = new xsltprocessor ;
9
+ include ('prepare.inc ' );
79
10
$ proc ->importStylesheet ($ xsl );
80
11
$ proc ->setParameter ('' , '' , '" \'' );
81
12
$ proc ->transformToXml ($ dom );
82
-
83
- ?>
84
13
--EXPECTF --
85
14
Warning: XSLTProcessor::transformToXml(): Cannot create XPath expression (string contains both quote and double-quotes) in %s on line %d
15
+ --CREDITS --
16
+ Christian Weiske, cweiske@php.net
17
+ PHP Testfest Berlin 2009 -05 -0 9
You can’t perform that action at this time.
0 commit comments