Re: AW: AW: [PHP] What's your call on XML?
| From: | php3 at developersdesk dot com | Date: | Wed, 22 Nov 2000 13:24:46 +0000 |
| Subject: | Re: AW: AW: [PHP] What's your call on XML? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-26621@lists.php.net to get a copy of this message | ||
Addressed to: Sebastian Stadtlich <Stadtlich@mediaworx.com>
php-general@lists.php.net
** Reply to note from Sebastian Stadtlich <Stadtlich@mediaworx.com> Wed, 22 Nov 2000 11:53:06
+0100
>
> > be working with. I will give you two examples of things that
> > will be much
> > easier with XML.
>
>
> to the first example : you used XML for you project because the
> newsprovider published them in XML. he could have given you the data in
> any format.
Yes, but like it or not, you are going to find more and more information
presented in XML format. I look forward to it, as it is easy to use.
> i had to create an XML-Based Infomation System for students.
> it WAS very easy easy to create. it was fast untill it had to deal with
> real data(=all the courses in that university) the data file was only
> 160k big but parsing it took ages. i thought maybe i'm stupid and/or the
> php-parser for XML sucked and parsed the same file with a java-xml
> programm. Same here : very slow and ate up a lot of memory.
>
I do hope the XML student records program was an academic problem, and not
a serious attempt to manage students. You are very correct that storing
the student info in XML sucks. In this setting a possible example for the
proper use of XML would be to transfer registration information from the
central registration database to a PC based grading program where you have
to send each instructor individual data for all his/her classes. That
transfer, and sending final grades back to the central database would be
good uses for XML. Especially if different groups are doing the programs
on each end.
This uses the ease of creating, verifying and parsing the XML data, so the
programmers on both ends can easily transfer data. Also if you take care
to ignore tags you don't understand, and provide reasonable defaults for
tags that are missing you can change the XML file format a little and still
have old programs work.
> second example : i don't know how the manual on php net is done,
Pretty much like I describe.
> but by
> it's speed i doubt that it is served directly from the XML-Files. i THINK
> that it uses the XML to feed some sort of Database and/or writes the
> output once and serves cached files.
The source code to the manual is created, stored, and managed in XML files.
I'm not sure about the interval, but a program is run to create the various
views of the manual. You are correct, it is not served to end users by
this program.
Names of the XML tags describe parts of the document like heading, or text,
and contain the actual text between the begin and end tags. The formatting
of the manual is described separately, and it is different for Postscript,
HTML and any other format someone cares to design.
> which brings me to the following
> conclusion : you have to know XML to get you data into MySql,Oracle or
> whatever and then use this to serve the content.
You _may_ have to know XML to get data in to the database. There are many
applications where there is no use for XML at all. It is a tool, with
specific uses, and even more ways to mis-use it. :)
> NEVER USE XML TO STORE
> THE DATA FOR YOUR SITES. it simply can't be done if the data grows to the
> size of the php-manual.
I very much agree with this. At least for large datasets.
>
> that's just my opinion and everybody should feel free to prove me wrong
> by pointing me to a big site that uses XML for live content.......
Store the content for a single web page in an XML file. Use separate XML
files for each page on the site. These are small files, so they still run
fast. Then you create separate things (I don't recall what they are
called) that parse your XML data and produce various kinds of output, say
WAP for cell phones, and HTML for browsers. You might even have different
formatting rules for IE and Netscape.
You maintain the text of the site in XML and let the things decide how to
format the data for each different browser. I am not doing this, and I
don't _know_ of anyone who is, but I've heard it in enough different places
that _someone_ must be.
I don't believe XML is the next best thing since semiconductor memory, but
it does have valid uses.
Rick Widmer
Internet Marketing Specialists
www.developersdesk.com
When all you have is a hammer,
everything looks like a nail.