XML Templates...

From: Date: Tue, 15 Feb 2000 17:41:47 +0000
Subject: XML Templates...
Groups: php.template 
Request: Send a blank email to php-template+get-23@lists.php.net to get a copy of this message
> Hi. > > My main goal with a template systeme is that I want the person using it to > > have zero knowledge in programming. I want anybody knwoing HTML to > copy/paste a html page to the template system and get it dynamic in a > minute. > > What's a point in separating the code from the look of the site if it is > to > make this look look like code too ? This restricts the person changing it > to the one understanding XML or at least programming. > [Derek Neighbors - OMBX] Response Within..... In due course any HTML author will have to know XML. That is the way the world is going. Wouldn't we rather be ahead of the curve than behind it. If you look at the spec anyone knowing HTML would have a short jump to learn XML in this context. As the tags are the same only with extended properties. And you can go back to HTML at any time. Have you seen Mozilla yet? They are using XML in a similar fashion to author their XUL content. They expect people to readily jump from HTML to XUL. This would be no different. In one sense this almost makes programming obsolete for many simple applications. It dumbs PHP down to a Cold Fusion level. By defining a few tags to point to databases and build queries you simple then add a property to the html. We are still in the infant stages of the implementation so it takes a little vision to see how it would work. Perhaps the following example would help. <?xml version="1.0"?> <document xmlns="http://www.w3.org/1999/xhtml" xmlns:jadeke="http://www.jadeke.org/2000/jadeke"> <jadeke:document xmlns="jadeke:x:html" xmlns:html="jadeke:x:jadeke" xmlns:php="jadeke:x:php"> <html> <jadeke:database id="dbName" dbtype="mysql" host="server.test.com" database="db_name" username="user" password="pass"/> <jadeke:dataset id="dsetName" src="dbName" /> <jadeke:datasource id="dsrcName" src="dsetName" /> <jadeke:query id="qryName" src="dsetName" sql="SELECT * FROM table" /> <table> <tr> <td> First Name </td> <td> Last Name </td> <td> SSN </td> </tr> <tr> <td> <jadeke:printvalue colName="FNAME" src="dsrcName" /> </td> <td> <jadeke:printvalue colName="LNAME" src="dsrcName" /> </td> <td> <jadeke:printvalue colName="SSN" src="dsrcName" /> </td> </tr> </table> </html> </jadeke:document> 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. Thanks, Derek Neighbors Administrative Technology Center Lead Client Server Programmer/Analyst Phone: 602-506-2273 Pager: 602-310-2428 Email: dneighbo@mail.maricopa.gov

« previous php.template (#23) next »