RE: [PHP4BETA] Can PHP do XML + XSL = HTML stuff ?

From: Date: Sat, 18 Mar 2000 18:25:52 +0000
Subject: RE: [PHP4BETA] Can PHP do XML + XSL = HTML stuff ?
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-12377@lists.php.net to get a copy of this message
Hello Lucas, On 18-Mar-00 13:04:28, you wrote: >> >But it may be ugly document which is hard to manage, >> >because you mix >> >structure (your own "hi-energy" tags) with presentation >> >classical HTML >> >tags like <table>, <font>, ... >> >> Right, but for the end users that is irrelevant. Any >> browser may display >> XHTML and that's what matters. Users could not care less of >> separation of >> content from data, that's a programmers concern. The >> original poster already >> has his data separated in the database. Serving HTML/XHTML >> is just a >> matter of insering that data into HTML templates. >You cannot put any kind of data into the structure of a relational The original poster presented is case assuming that his data is in a database and not in the XML format. So, if his data is in the database it is because it fits well there. >database. (Actually, the thing I'm working on is about juridical >documents - their structure is not as straight as you need it to fit >it into fields and tables). But you _can_ do it in XML. That's why I XML is most suited for hierarchical data. Although the relational model does not ease the management of hierachical data, that doesn't mean you can't do it naturally. There are DBMS that come with SQL extensions to support hieararchical data. For those that don't support hierarchical data, there ar normalization techiniques that may be applied. If you are interested, I recommend you this book: "Joe Celko's: SQL for Smarties" . It comes with two chapters on modeling tree like relationships and even a chapter or graph relationship models. Look here for some detail. Soon I'll be posting a review here: http://phpclasses.UpperDesign.com/products.html Once you layed your hiearchical data in a relational database you may benefit of the very mature relational DBMS products that we have today. This means that data searching can be as fast as the best DBMS that you can use. Anyway, I think the simplest way of modeling tree relation ships is to map tree elements into an array where the indexes are multidimensional, but if you use an associative array you can turn it all into a flat array which will take a table or two in a relational database. Turning a XML document data into a flat array is what this generic XML parser PHP class does. It really simplifies parsing any XML format: http://phpclasses.UpperDesign.com/browse.html/package/4 >want to store it _in_ XML (as text-field). I've developed a specific >XML-format that represents the structure of these documents - this has >nothing to do with (X)HTML. And _if_ I want to show it to a web-client >(that's not the only purpose of the format), I transform it to XHTML >using XSLT. But if you store the data in the database text field already in XML you loose the ability to index and search over your data. If you are not willing to take advantages of the databases indexing and searching abilities,m you might as well store the data in XML files on disk that is much faster than storing it in text fields. >> >> I can see you never tried any of that in practice or >> >> else you wouldn't be >> >> say what you are saying. >My XSL-Transformations are working, I just don't use PHP to call it. >Anyway, I don't have to justify anything, because I know what I'm >saying (and I know what is - and what is not - appropriate style of >writing on a list about people and projects I even don't know). I'm sorry, maybe I have not made myself clear. I had no intention make you feel offended with what I said. I just wanted to emphasize that you can't just assume that it is ok to spend CPU and Web server time just because faster CPUs are becoming cheaper. What happens in practice is that when you need to tune your site to serve a large amount of simultaneous users, you either use more hardware of use faster software. When possible the later is preferred. This is why assuming that faster CPUs are becoming cheaper is not a serious argument to ignore the execution overhead of the software solutions. Regards, Manuel Lemos Web Programming Components using PHP Classes. Look at: http://phpclasses.UpperDesign.com/?user=mlemos@acm.org -- E-mail: mlemos@acm.org URL: http://www.mlemos.e-na.net/ PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp --

« previous php.version4 (#12377) next »