Helpful Information
 
 
Category: Programming Languages More
Questions about XML in general.

I've been a web developer over the past 4 years now, before I only did small perl cgi scripts and a little javascript, but in the past year I've been getting more into php and mysql development. I keep hearing about XML, but can never seem to find a description of XML that makes complete sense. Could someone give me a small example of a way XML benefits a web site. Seeing a devshed tutorial explaining this would probably enlighten several people.

As an example maybe, I'm currently writing a newscript in php/mysql which is based off of a perl script I've used for a while called Newspro. Would using XML in this project benefit me? If so how? The basic setup of my script is posting news, users can comment on news, and there can be multiple categories to submit news to.

Thanks for any help in advance

-Justin King
School District of Superior Web Coordinator www.superior.k12.wi.us (http://www.superior.k12.wi.us)

XML is very much like html except you make your own tags. You have to create a dtd file which will tell the tags of how they function. For example, you cannot use the <table> tags without the <tr> and <td> tag. So basically in the dtd documents you set up the tags so that they must contain a specific information in order for the tags to work. The best thing about XML is that they give you full flexibility, better readibilty and it is easier to work with large sites.

You can make a question and answer combo tags by naming it <qacombo> and it must contain the following two tags: <question> and <answers> otherwise they won't work. Basically you can use cascading style sheets to style the details in the tags (much easier to style for large sites). In the dtd document you set up the <qacombo> tags by the following:

<!ELEMENT qacombo (question|answers)>
<!ELEMENT question (#PCDATA)>
<!ELEMENT answers (#PCDATA)>

So, if you are interested in learning more about XML or better yet, XHTML then I suggest you to get a good book about them, and read it, then you will easily become a master of it.

For those of you who are struggling with am appreciation of what xml can do for you, go to www.w3schools.com/xml (http://www.w3schools.com/xml) Do this and the tutorial on xsl and it will all become clear. It did for me. You may also want to visit Microsoft's site on MSXML. This has loads more info. I have been using xml for a week after starting a new job and I can already see the benefits of using it.

[This message has been edited by softgazobee (edited August 10, 2000).]

Someone mentioned that XML's only use is exchange of hierarchical data between web systems. There's no need to use XML in a closed web site.

Not true. Microsoft (is that a bad word here?) has a great example of leveraging XML and XSL on an integrated web site => http://msdn.microsoft.com/downloads/samples/internet/xml/multiple_views/Multiple_js.htm .

We have a MySQL database to track our notebook/desktop inventory. One view shows h/w and and config for one PC, latest network / VPN connection info, and the names of all apps installed on the system all on one screen. Some say 'why not hard code the view in HTML?' I had to think of a reason why XML and XSL would be useful in this case (besides their own personal development investment in XML!).

Here it is: maybe we'll soon have support staff running around the office with a wireless PDA. They bring up the record for the workstation they are servicing, but the view expects 1024 x 768. If they use XSL, they can format the view to the smaller display, but the data fetch remains the same. Also, an executive might want a different view that a support technician. Separate the data from the formating! Make your site architecture object-oriented!

My $0.02 worth.

J










privacy (GDPR)