Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-17-2004, 01:27 AM   PM User | #1
Nightfire
Senior Coder

 
Nightfire's Avatar
 
Join Date: Jun 2002
Posts: 4,266
Thanks: 6
Thanked 48 Times in 48 Posts
Nightfire is on a distinguished road
Is this the right useage of xml? Plus benefits of xml

I am completely baffled with xml, I dare admit it.

I've looked at tutorials for xml and xsl(i think it's called that), but I fail to see any difference between that and say xhtml and using html markup.

My main question is, is it suitable to use an xml document for use as a template in php? or should I just stick to xhtml instead?

I really can't see the benefits of xml, but I'm hoping someone can show me. Why xml and not xhtml with a serverside language supporting it?
__________________
Blue Panda
Website Design | 1 Pound Ads | 'ow much? | Coding Geeks
Nightfire is offline   Reply With Quote
Old 02-17-2004, 03:28 PM   PM User | #2
liorean
The thread killer


 
Join Date: Feb 2003
Location: Umeå, Sweden
Posts: 5,575
Thanks: 0
Thanked 84 Times in 75 Posts
liorean will become famous soon enoughliorean will become famous soon enough
Well, first of all, I'd like to say you're confusing things. XML ans XSL are both XML. In fact, XHTML is one of the best examples of XML you will find. The question is rather what XML gives over tagsoup or SGML.

XML is clean. The syntax is consistent, the well-formedness and grammar rules are pretty unambigous, and the validity rules are clearly separated from the syntax rules. SGML is not as clean, but more powerful. In contrary to modern belief SGML has grammar and well-formedness rules as well, but the language is not at all as unambigous as XML is. Tagsoup is less consistent, has error correction for pretty much anything, and uses no validity system.

So, what does that mean XML gives that SGML or Tagsoup doesn't?
Well, it's far easier to parse. It doesn't allow grammar errors or well-formedness errors, so when you test your documents you see those types of errors quickly. Because there is no ambiguity XML makes sure that all user agents will build the same internal representation of the structure. That means it's reliable across user agents. Then there's the associated languages and tools that only works with XML, not SGML or Tagsoup.


Well, back to XHTML and XML. As said, XHTML is XML. I've tried to describe what XML is in a few posts on this forum. Why don't you search for those posts and read them through, and then ask again for clarifications or further explanations?
__________________
liorean <[lio@wg]>
Articles: RegEx evolt wsabstract , Named Arguments
Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards
liorean is offline   Reply With Quote
Old 02-24-2004, 08:23 AM   PM User | #3
ConfusedOfLife
Regular Coder

 
Join Date: Jul 2002
Location: Iran
Posts: 695
Thanks: 0
Thanked 0 Times in 0 Posts
ConfusedOfLife is an unknown quantity at this point
Nightfire, I don't know much about XML, but I think I know the difference between XML and XSL and if I tell ya that XSL is itself written by XML then I think you get more confused! I only started learning XML because I was hearing its name a lot and I thought it's better I go and learn it! The first thing I did was searching kazza for a book and I found XML by Examle that's free to download as well! So, I grabbed the book and now that I'm around page 150 I really think that I have no problem with XML concept and I can understand its value (before that I always used to hear that XML is good, it's great, it can do lots of things, it let us communicate with other sites and ..), so, I think it's better that you go and get that book too, because most of the times reading articles at the beginning when we know nothing doesn't help that much, it only adds to our confusion!

As for as XSL: Extensible Styling Language, it's a styling language! We have two sort of styles, one that works with the formation of document, like it says the color of document should be red for example or the fonts should be 12px. Yes, it's something like CSS. But the other thing that's prettier and more important is XSLT or XSL Transformation, do you know what it does?! It's exactly like preg_replace in PHP! We can give it a XML document and this is the XSLT that defines for example tag <para> should be replaced with tag <p>. In this way you can write your own document in XML and change it whenever you like to any language (HTML for example) or even plain text! You can use this method to make a newsletter in XML and then make several copies of it in HTML, text, WML or whatever! You can also use RSS: Really Simple Syndication from the other sites to get their contents and show it in any style that you like in your site to any device! This is a whole new world! I LOVE XML!
ConfusedOfLife is offline   Reply With Quote
Old 02-28-2004, 04:06 PM   PM User | #4
M@rco
Regular Coder

 
Join Date: Oct 2003
Location: London, UK
Posts: 411
Thanks: 0
Thanked 1 Time in 1 Post
M@rco is an unknown quantity at this point
Quote:
Originally posted by ConfusedOfLife
The first thing I did was searching kazza for a book and I found XML by Examle that's free to download as well!
It's only "free" because it's available on the P2P networks in Ebook form! It's a published, copyrighted work like any other, and is NOT free. If you like it, buy it.

http://www.amazon.com/exec/obidos/tg...64612?v=glance
http://www.marchal.com/go/xbe/
__________________
Marcus Tucker / www / blog
Web Analyst Programmer / Voted SPF "ASP Guru"
M@rco is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:47 PM.


Advertisement
Log in to turn off these ads.