SitePoint Sponsor

User Tag List

Results 1 to 15 of 15
  1. #1
    <title class="lol"> bronze trophy TehYoyo's Avatar
    Join Date
    Feb 2012
    Location
    Northeast Chicago Suburbs
    Posts
    806
    Mentioned
    18 Post(s)
    Tagged
    1 Thread(s)

    XML, XHTML, and HTML4

    I'm wondering what exactly the history of XML is.

    I'm also wondering the difference between XHTML and HTML4 is. Is XHTML still HTML? Just a different version? Or is it...XML (whatever that is).

    Help please?
    ~TehYoyo

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,299
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by TehYoyo View Post
    I'm also wondering the difference between XHTML and HTML4 is. Is XHTML still HTML? Just a different version? Or is it...XML (whatever that is).
    Check out this forum's sticky thread on the same topic:

    http://www.sitepoint.com/forums/show...ML-vs-HTML-FAQ

  3. #3
    <title class="lol"> bronze trophy TehYoyo's Avatar
    Join Date
    Feb 2012
    Location
    Northeast Chicago Suburbs
    Posts
    806
    Mentioned
    18 Post(s)
    Tagged
    1 Thread(s)
    So then what is XML? Is it a really old language?

    ~TehYoyo

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,299
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    No, it's a very important language. See if thses help:

    http://www.whatisxml.org/

    http://en.wikipedia.org/wiki/XML

    And, although w3shcools is not in vogue these days, this is a fairly clear intro:

    http://www.w3schools.com/xml/xml_whatis.asp

  5. #5
    <title class="lol"> bronze trophy TehYoyo's Avatar
    Join Date
    Feb 2012
    Location
    Northeast Chicago Suburbs
    Posts
    806
    Mentioned
    18 Post(s)
    Tagged
    1 Thread(s)
    But is it old? What came first, HTML or XML?

    ~TehYoyo

  6. #6
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,299
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    HTML is a little older than XML, but they have slightly different purposes. There's plenty you can read online about this.

  7. #7
    <title class="lol"> bronze trophy TehYoyo's Avatar
    Join Date
    Feb 2012
    Location
    Northeast Chicago Suburbs
    Posts
    806
    Mentioned
    18 Post(s)
    Tagged
    1 Thread(s)
    I'm confused about when W3schools says that XML doesn't do anything...what do they mean? Is it meant to be interpreted directly by the reader of the XML (that is, should we interpret something like:
    Code:
    <to>Ralph.m</to>
    <from>TehYoyo</from>
    as to Ralph.m from TehYoyo? That is, does the recipient of XML have to read the code or is it displayed in some form.

    I also read in one of the articles (can't remember where) that XML is an application language...is this like a program? How does it make a program if it doesn't do anything? Or is this just a w3schools screw-up?

    Thanks for patience. I can tell it's wearing thin
    ~TehYoyo

  8. #8
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    XML does nothing. Its up to an application to take XML and do something with it. XML just creates a structure for parsing. On other words, it is a series of rules that are highly generalize allowing it to be used for multiple applications. For example: SVG, XPS, XHTML. Are XML documents, specs built atop the rules defined by the XML spec. This allows for any general XML parser to handle any XML-based document.

    One of the biggest uses of XML is Microsoft Office when they released the new document formats that everyone was up in arms about. Office Open XML is what they call it.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  9. #9
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,299
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    As I understand it, XML is a markup language like HTML, but with a different purpose. But it can be displayed in a browser (well, some browsers) and can be styled with CSS. The main use of XML that I'm familiar with is an RSS feed, that has a basic structure like

    Code:
    <rss>
    <channel>
    	<title>Site Title</title>
    	<item>
    		<description></description>
    	</item>
    </rss>
    An RSS feed usually displays as a web page in your browser. But with something like PHP, you can easily extract information from an RSS feed for various purposes, such as displaying an item from the feed on your site.

  10. #10
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,862
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    XML is a language for defining markup languages. It is a simplification of SGML which in turn was based on the original GML. HTML between versions 2 and 4 is a markup language based on SGML.

    Examples of markup languages based on XML include XHTML, RSS, and office documents created using the latest version of MS Office (although Microsoft couldn't resist bending the XML rules slightly).
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  11. #11
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,892
    Mentioned
    123 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by ralph.m View Post
    As I understand it, XML is a markup language like HTML, but with a different purpose. But it can be displayed in a browser (well, some browsers) and can be styled with CSS. The main use of XML that I'm familiar with is an RSS feed...
    Although the official specs say that XML is a language, I find it more helpful to think of XML as defining a syntax than a language. Essentially it's about separating markup (ie <tags> and closing </tags>) and content (everything inside the <tags>...</tags>), having well-formed and correctly nested tags that are closed in the reverse order they are opened in, and rules about special characters and character encoding. XML itself doesn't define what the tags should be or should do, but it gives a framework that allows people to define their own language using XML rules.

    As well as XHTML, RSS and some forms of office documents, another instance of XML you may have come across is SVG. This uses a completely different set of tags to XHTML and RSS, but the basic rules behind the structure of a document remain the same.

  12. #12
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by stephen
    It is a simplification of SGML
    Hm, I wouldn't say that.

    Being a subset of SGML, it certainly only takes a few rules from SGML (as HTML too)... so I guess there you could say simplifying... but after that, it adds in a crapload of its own special rules, making it much more complex than SGML.

    Teh Yoyo, if you're only worried about websites, you're likely to encounter XML doing a lot of the same stuff people use JSON for. A data-storage format/syntax.

  13. #13
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,862
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Both SGML and XML are meta languages - they are used to define other languages such as HTML, XHTML, RSS, .doc etc.

    The ipurpose of creating XML from SGML was supposed to be to provide a simpler set of rules so as to make it easier to write programs that follow them. If it is actually more complicated then it has no real reason to exist. I suspect that any 'complexity' is actually there to make things simpler for actually using it (not necessarily fto make it easier to write by hand).
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  14. #14
    <title class="lol"> bronze trophy TehYoyo's Avatar
    Join Date
    Feb 2012
    Location
    Northeast Chicago Suburbs
    Posts
    806
    Mentioned
    18 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Stomme poes View Post
    ...you're likely to encounter XML doing a lot of the same stuff people use JSON for. A data-storage format/syntax.
    Oh! Psshhh....yeah...psshh...JSON. Of course! *Googles JSON*

    So from what I've read, XML gives a structure of how to write code, whereas HTML defines what certain tags do?

    ~TehYoyo

  15. #15
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    So from what I've read, XML gives a structure of how to write code, whereas HTML defines what certain tags do?
    So far as I'm concerned, they both structure data. HTML sorta follows SGML rules (except when it doesn't), and XML follows XML rules. JSON follows JSON rules. They just take your raw data and let you structure it so that software with a parser knows where to go if you ask it for some type of data. Tags themselves don't actually do anything.... it's just that with HTML, browsers not only have their parser recognise those tags, they also happen to have a default CSS stylesheet to give them styles.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •