Magma
01-08-2005, 10:37 PM
if lets say i have a medium amount of data which i wan to publish on my website. Is it advisible to store it using XML and them retrieve them whenever i need them using HTML?
|
Click to See Complete Forum and Search --> : Storing data in XML Magma 01-08-2005, 10:37 PM if lets say i have a medium amount of data which i wan to publish on my website. Is it advisible to store it using XML and them retrieve them whenever i need them using HTML? MstrBob 01-08-2005, 10:58 PM It has been done before, yes. This method is often used to get a total seperation of content from presentation. You can transform the data server side, which grants you a whole variety of options. Let's say you store your content in an XML state. Now, you retrieve it using a server side langauge, and can transform it into HTML. But, you can also transform it into, say, a PDF file. Or a Word file. Or plain text. All of this is on the fly, which means that: 1) You won't actually have several different versions stored on your server 2) If you make a change to the XML data, the change will take place in the different versions that the server creates. The downside to this method is that the server has to transform the data on each request, but with a decent server this shouldn't be an issue at all. Magma 01-08-2005, 11:19 PM Now, you retrieve it using a server side langauge, and can transform it into HTML are you referring to using XSL or XSLT? by the way, whats d difference btwn those 2? which should i learn? But, you can also transform it into, say, a PDF file. Or a Word file. Or plain text. All of this is on the fly how do i do that? is there any tutorial anywhere where i can learn? The downside to this method is that the server has to transform the data on each request, but with a decent server this shouldn't be an issue at all. how does d server do that?does it mean that if im surfing some site then i decide to transfer d data i c on dat site into lets say pdf, it'll open acrobat in my computer and transform it to pdf? MstrBob 01-08-2005, 11:37 PM I'm not an expert on XSLT, but I do beleive it can run server-side. However, if I understand it correctly, XSLT will only help you convert it into other XML formats, like XHTML. Check out this W3Schools tutorial: http://www.w3schools.com/xsl/default.asp But I know using a Server Side Language, like PHP, and most likely the others, you can take that information and transform it into other formats. There are a myriad of tutorials, depending on what server side langauge is supported by your server. But, now, say you also want to make available a PDF version of your pages to users. You can have a link, something like "Get the PDF version of this page", which in turn, would link to a dynamic server-side language file that would grab the contents from your XML file and transpose it into a PDF file. But the method for doing this is dependant on your options available. Magma 01-08-2005, 11:42 PM is there a limit to the amount of data i can store in XML or how big d XML file can get? lets say i want to store different types of fruits in fruits.xml what is d maximum number of entries? MstrBob 01-08-2005, 11:48 PM As large as the amount of disk space you have, and the amount of processing power you have to use to read the file. If the file is getting rather large, I suggest you break fruit.xml down into, say, apple.xml, banana.xml, orange.xml, grape.xml, and the like. I mean, if the file is getting over 10k, then you want to start breaking it down, seeing as how the server has to read through the file on each request. Magma 01-09-2005, 03:28 AM I see, MasterBob thanks alot man...u have answered alot of my questions..not just here in this thread but elsewhere too..thx 4 ur time.. webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved. |