This is a discussion on Re: [PHP] XML within the PHP General forums, part of the PHP Programming Forums category; Hi there, I read this interesting thread and come up with some questions. 1. How efficient is to use XML+...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi there,
I read this interesting thread and come up with some questions. 1. How efficient is to use XML+XSLT solution? Does it add processing overhead to the system? 2. Do you have some examples which can describe the separation of layers using the XML+XSLT technology? 3. Currently i am storing the data in the mysql database. so first i need to create the xml file on fly and then i need to integrate this xml file with the xsl style sheet. Please corret if i am wrong anywhere So far i have above questions in my mind. If i come up with other questions then i will let you know. Thanks Hardik --- Ray Hunter <bigdog@venticon.com> wrote: > XML is a way to store data in a structure format > that is correct and is > platform independent; meaning u can share data with > anything that > understands xml format. > > For web applications xml allows you to send data to > the client and have > the browser do the parsing for you. (I would suggest > ie5.5 and ns6.0 > browsers if you are doing client-side parsing). If > you are doing > server-side php parsing then i would suggest using > domxml+domxslt or > using xslt (sablotron). Then you can parse the xml > doc, get xhtml(html) > and send that to the user. > > The benefits are seperation of logic and > presentation in your php. All > presentation code should be in your xslt style > sheets and all logic > should create a data document (xml). This allow you > to change the > presentation with out changing logic. > > -- > BigDog > > On Tue, 2003-07-08 at 04:26, Petre Agenbag wrote: > > Hi List > > > > Firstly, this question is arguable more about XML > than PHP, but they are > > interlinked, so I hope it is "topical" for this > list. > > > > Firstly, Where I come from: > > > > I am VERY comfortable with PHP/MySQL on Linux and > understand all those > > concepts. > > > > Now I'm trying to see the benefits of XML, and > quite frankly, I just > > cannot see why one would want to use it... > > > > Anyway, I don't want to start a discussion on that > from. > > > > I have done extensive reading on XML/XSL(XSLT : > XHTML), DTD and XML > > parsing on browser and server side. > > > > I arguable still don't have a 100% understanding > of exactly how things > > fit together, but the little bit I think I got so > far is: > > > > I would use an XML doc to package my data in a > structure. > > This XML file is "useless" on it's own, and good > for transporting data > > to another app or client. > > Should I need to do something with the data, I > would look at XSL and in > > particular XSLT in order to convert the XML into > XHTML so a browser can > > display the data ( so we can safely assume that I > am only interested in > > the web applications of XML) > > > > This is where I'm starting to get a headache, > because now it seems that > > there are browser issues wrt XSL, and one also > have the added choice of > > parsing the XML with the browser or on server > level. > > > > For me, parsing it on browser level must be a > no-no, as I would assume > > that it's would take alot of effort to find out > what type of browser the > > client has, then load the appropriate XSL file for > that browser. > > > > So, I'm here, with the server side XML parsing in > mind. > > > > Now on M$ systems, it seems that IIS has built in > ActiveX XMLDOM parsing > > built in, and you can "easily" parse the XML > document by using ASP etc. > > > > So can I assume that this is also true with > PHP/Apache, ie, Apache has a > > built in XML parser and I can use PHP fnuctions to > parse my XML file on > > the server side and thus "pump" out XHTML that is > compatible with all > > past and future browsers? > > > > Also, what is the procedure that most of you > (members of the PHP lists) > > follow when dealing with XML. ie, do you go for > the client side parsing > > or do you do server side parsing. And how do you > decide when to use XML > > and when to stick to trusty old PHP/MySQL? ( > Sorry, know this is > > probably the dumbest question I can ask, but I > really battle to see when > > to use it, or rather WHY I should use it seeing > that the data is > > arguably "static" in nature ( I would either get > the XML file from > > somewhere else, or I would generate it from some > source and pass it on, > > effectively creating a little data island/snapshot > of the actual data at > > a point in time?) > > > > Thanks for any input. > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com |
|
|||
|
Ray Hunter <bigdog@venticon.com> wrote:
> > > 1. How efficient is to use XML+XSLT solution? Does it > > add processing overhead to the system? > > The efficientcy is relative to many factors, however I can stress this. > The style sheets can be cached client side and then only xml data can be > sent to the user. This reduces bandwidth and allows the transformation > to be done on the client side instead of server side. Also not that xml > + xslt transformations can be done server side. I usually do browser > checks to determine if the browser is capable of handling xml+xslt > transformations: if so then i send the files. Now if the browser is old > or has issues (i.e. Internet explorer 5.5) then i can do the > transformation server side and send html. Also note that you can set up > a caching system at this point. I opened the page with Opera I was doing in XML+XSLT and my page disappeard :( Back to browscap days... i thought we were done with that. > > If the transformation is done server side then yes you have that over > head. However, if you are only serving up xml files and xslt files (part > of the time on xslt) then u are reducing server load. What I'm afraid of is that xslt will have the same problem that html had with the browser wars. excpecially since all layout and rendering is done based on what the client's software thinks. Curt -- |
![]() |
| Thread Tools | |
| Display Modes | |
|
|