RE: XML Templates...
[email protected] ("Jade Meskill")
| Newsgroups | php.template |
|---|---|
| Message-ID | <[email protected]> |
> On Tue, 15 Feb 2000, Derek Neighbors - ATCX wrote: > > This of course is still a work in process but this sample > should currently > > work. Please note that this will only bring back one record. There are > > ways around this currently that are a semi-kludge. Where > actual PHP code > > could handle the while loop for example. In the future however a simple > > <while> tag could be implemented to accommodate this behavior. > However an > > author could easily go and create the html document and a > programmer could > > add the properties to connect the data. I think the real goal > is to allow a > > "non" programmer the ability to do some of the "easier" data binding. > > Yes, I understand the purpose behind Jadeke and it's a good one. > However, I'm not sure that HTML designer people would have any need for > DB calls since the programmer should take care of that. Of course, I'm > talking about largish applications which are worked on by a team of > people rather than one person. Sorry to drag this out any further (and believe me, I'm not trying to push Jadeke on you, just merely trying to explain my point of view, and this is all about discussion right?), but let me try to explain it this way... this is basically the same thing you are talking about with the "FastTemplate" kind of solution... only the developer can use XML... (forgive any mistakes, Derek and I whipped it up in a couple of minutes :) so the HTML designer creates a vanilla HTML document awaiting ties to the database... See before.html (attached) Then the developer comes in behind the designer and adds the database functionality to it... this saves the designer and the developer from having to learn unfamiliar syntax (as far as the current template sytem looks) to be included in the template (and is much more standardized IMHO). See after.xml (attached) We are really talking about the same thing, just a different approach... Thanks for your time. :) Jade Meskill Email : [email protected]
before.html
(text/html, 1.3 KB)
<html>
<head>
<title> My Lame Example Page </title>
</head>
<body bgcolor="navy">
<font color="white">
<h1 align="center">Employee Table</h1>
</font>
<table align="center" bgcolor="white" cellspacing="0" border="1">
<tr bgcolor="maroon">
<td>
<font color="white">User Name</font>
</td>
<td>
<font color="white">Employee</font>
</td>
<td>
<font color="white">Email</font>
</td>
<td align="center">
<font color="white">Status</font>
</td>
<td align="center">
<font color="white">GMT</font>
</td>
<td align="center">
<font color="white">Salary</font>
</td>
<td align="center">
<font color="white">Active</font>
</td>
</tr>
<tr>
<td>
name
</td>
<td>
last_name, first_name
</td>
<td>
email
</td>
<td align="center">
status
</td>
<td align="center">
gmtmodifier
</td>
<td align="center">
salary
</td>
<td align="center">
active
</td>
</tr>
</table>
</body>
</html>
after.xml
(text/xml, 2.4 KB)
<?xml version="1.0"?>
<jadeke:document xmlns="http://www.w3.org/1999/xhtml" xmlns:jadeke="http://www.jadeke.org/2000/jadeke">
<jadeke:database id="dbTest" dbtype="mysql" host="localhost" database="test" username="fred" password="" />
<jadeke:dataset id="dsetTest" src="dbTest" />
<jadeke:datasource id="dsrcTest" src="dsetTest" />
<jadeke:query id="resource" src="dsetTest" sql="SELECT * FROM resource" />
<html>
<head>
<title> My Lame Example Page </title>
</head>
<body bgcolor="navy">
<font color="white">
<h1 align="center">Employee Table</h1>
</font>
<table align="center" bgcolor="white" cellspacing="0" border="1">
<tr bgcolor="maroon">
<td>
<font color="white">User Name</font>
</td>
<td>
<font color="white">Employee</font>
</td>
<td>
<font color="white">Email</font>
</td>
<td align="center">
<font color="white">Status</font>
</td>
<td align="center">
<font color="white">GMT</font>
</td>
<td align="center">
<font color="white">Salary</font>
</td>
<td align="center">
<font color="white">Active</font>
</td>
</tr>
<!-- This syntax is still experimental and may not work quite like this -->
<jadeke:while /><jadeke:not /><jadeke:eof src="dsetTest" /><jadeke:do>
<tr>
<td>
<jadeke:printvalue colName="name" src="dsrcTest" />
</td>
<td>
<jadeke:printvalue colName="last_name" src="dsrcTest" />
, <!-- adds comma between names -->
<jadeke:printvalue colName="first_name" src="dsrcTest" />
</td>
<td>
<jadeke:printvalue colName="email" src="dsrcTest" />
</td>
<td align="center">
<jadeke:printvalue colName="status" src="dsrcTest" />
</td>
<td align="center">
<jadeke:printvalue colName="gmtmodifier" src="dsrcTest" />
</td>
<td align="center">
<jadeke:printvalue colName="salary" src="dsrcTest" />
</td>
<td align="center">
<jadeke:printvalue colName="active" src="dsrcTest" />
</td>
</tr>
<jadeke:next src="dsetTest" />
</jadeke:do>
</table>
</body>
</html>
</jadeke:document>