Hmmz.. Raar
Ik heb een XSL stylesheet:
en een XML bestand:
en de php file:
Alleen als ik dus een
Alvast bedankt (sorry van die grote lappen tekst)
Ik heb een XSL stylesheet:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
| <?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method = "html" />
<xsl:template match="/">
<html>
<head>
<title><xsl:value-of select="page/title"/></title>
<style type='text/css'>
<!--
td,body { font-family: Verdana; font-size: 8pt; color: #000000; }
form {display: inline};
a { color: #000000; font-family: verdana; text-decoration: none; }
a:HOVER { color: #000000; font-family: verdana; text-decoration: underline; }
.menu { font-family: verdana; font-size: 8pt; color: white; text-decoration: none; font-weight: bold; }
.menu:hover { font-family: verdana; font-size: 8pt; color: white; text-decoration: underline; font-weight: bold; }
.itext {font-family: "Verdana"; font-size: 10pt; color: "#000000"; background-color: "#FFFFFF"; border: 1 solid #000000; width: "200px"; };
.ibutton {font-family: "Verdana"; font-size: 10pt; color: "#000000"; background-color: "#FFFFFF"; border: 1 solid #000000; width: "98px" };
-->
</style>
</head>
<body bgcolor="E5E5E5">
<table width="750" cellpadding="5" cellspacing="1" border="0" align="center">
<tr>
<td colspan="2" background="templates/images/1.gif" valign="top" height="75">
<table height="75" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="50%">
<font color="white" size="6">ministratie</font>
</td>
<td width="50%" align="right" valign="top">
<table width="75%" cellpadding="4" cellspacing="1" border="0" bgcolor="black">
<tr><td bgcolor="E5E5E5"><b>Niet ingelogd</b></td></tr></table></td></tr></table></td>
</tr>
<tr>
<td width="200" rowspan="2" background="templates/images/1.gif" valign="top"><div class="menu"><b>
<a class="menu" href="index.php">Home</a></b></div></td>
<td width="550" valign="center" background="templates/images/2.gif" height="10"><b><font size='1'>» <a href='index.php'>Home</a> / <a href='index.php'>Login</a></font></b></td>
</tr>
<tr>
<td width="550" background="templates/images/3.gif" valign="top" height="400">
<xsl:for-each select="page/container[@position='left']/block">
test
ID: <xsl:value-of select="@id" /> -
<b><xsl:value-of select="title"/></b><br/>
</xsl:for-each>
</td>
</tr>
<tr>
<td colspan="2" background="templates/images/1.gif" height="30" align="center" valign="center"><div class="menu">Copyright 2003, bedrijfsnaam. Alle rechten voorbehouden.</div></td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet> |
en een XML bestand:
XML:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| <?xml version="1.0" encoding="ISO-8859-1"?> <page> <pageid>1</pageid> <title>Welkom</title> <header>afbeelding.gif</header> <container position="left"> <block id="1"> <title>Blaat</title> <content>Dit is dus een stukkie tekst. . bla bla bla</content> </block> <block id="2"> <title>Blaat</title> <content>Dit is dus een stukkie tekst. . bla bla bla</content> </block> </container> </page> |
en de php file:
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| $xml = join('',file("index.xml")); $xsl = join('',file("internal/templates/standaard/template.xsl")); $arguments = array('/_xml' => $xml,'/_xsl' => $xsl); $xslt = xslt_create(); $output = xslt_process($xslt, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments); if ($output) { echo $output; } else { echo "Error Code: " . xslt_errno($xslt) . "<br>" . xslt_error($xslt); } xslt_free($xslt); |
Alleen als ik dus een
code:
er in zet.. dan krijg ik een error.. namelijk:1
| of <br> |
Ik denk dat het te maken heeft met ENCODING TYPE.. maar ik heb dat al veranderd in andere types maar het werkt niet.. Wat doe ik nu precies fout.. Search vond ook niet veel nuttigs..Warning: Sablotron error on line 49: XML parser error 7: mismatched tag in c:\program files\easyphp\www\xml\index.php on line 9
Error Code: 2
XML parser error 7: mismatched tag
Alvast bedankt (sorry van die grote lappen tekst)