SitePoint Sponsor

User Tag List

Page 7 of 11 FirstFirst ... 34567891011 LastLast
Results 151 to 175 of 265
  1. #151
    SitePoint Member Sasha Smaili's Avatar
    Join Date
    Nov 2007
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank u tommy XD :P

  2. #152
    SitePoint Enthusiast
    Join Date
    Dec 2004
    Location
    India
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    nice article

    nice post.

  3. #153
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile Great

    Thank you for the information, it was very useful. I just started building pages using divs, which are much more effective than tables...but I'm still learning more about xhtml.
    If you are looking to build a website we offer an easy solution.

  4. #154
    SitePoint Enthusiast
    Join Date
    Apr 2008
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the covering up everything about html and xhtml.

  5. #155
    SitePoint Member
    Join Date
    Mar 2006
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is a very useful post to understand the difference of HTML and XHTML, thanks a lot

  6. #156
    SitePoint Member
    Join Date
    May 2007
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot man

  7. #157
    SitePoint Guru Webinsane's Avatar
    Join Date
    Oct 2005
    Location
    Montenegro
    Posts
    898
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Damn where is that thank you button and why my doesn't validate hehe

    Good work!
    CUBE SCRIPTS MEDIA
    REAL ESTATE SCRIPT 2.0 | Software for Real Estate Agencies

  8. #158
    Non-Member
    Join Date
    Oct 2007
    Location
    United Kingdom
    Posts
    623
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Great thanks

  9. #159
    SitePoint Member
    Join Date
    Aug 2008
    Location
    Leicester, UK
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Interesting post!

  10. #160
    SitePoint Enthusiast
    Join Date
    Aug 2008
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is the first time that I know ie doesn't support xhtml at all.
    I have been using xhtml for long time with wordpress themes.

  11. #161
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Justin, you may have written XHTML markup, but if you haven't had any problems in IE then you haven't been using XHTML at all.
    Birnam wood is come to Dunsinane

  12. #162
    SitePoint Addict
    Join Date
    Jun 2007
    Location
    Sydney, Australia
    Posts
    253
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't quite understand why serving XHTML as text/html is harmful. I use it because I like the fact that all tags are closed and because the html validator will pick up some things when you give it HTML, which it won't when you give it HTML. eg, forgetting to close your <p>

  13. #163
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by znebojsa View Post
    I don't quite understand why serving XHTML as text/html is harmful...
    Browsers treat it as invalid HTML. Lose all the benefit of XHTML.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  14. #164
    SitePoint Addict
    Join Date
    Jun 2007
    Location
    Sydney, Australia
    Posts
    253
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by logic_earth View Post
    Browsers treat it as invalid HTML. Lose all the benefit of XHTML.
    What do you mean browsers treat it as invalid HTML? It renders the same doesn't it? And, you lose the benefits of XHTML, but how is that worse than HTML without benefits of XHTML?

  15. #165
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by znebojsa View Post
    What do you mean browsers treat it as invalid HTML? It renders the same doesn't it?
    Thats because browsers are forgiving. Where as if you were using real XHTML it should spit errors out at the smallest mistake.
    And, you lose the benefits of XHTML, but how is that worse than HTML without benefits of XHTML?
    Not wrose, just pointless to use XHTML since it is just being used HTML tag soup.

    http://www.sitepoint.com/forums/show...&postcount=143
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  16. #166
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by znebojsa View Post
    I don't quite understand why serving XHTML as text/html is harmful.
    It doesn't have to be. As long as the document still works when served as an application of XML, there's no harm. It's just pointless. But if the document must be served as text/html to work, then you're engaging in harmful practices (in my opinion). You're definitely not using XHTML.

    Quote Originally Posted by znebojsa View Post
    I use it because I like the fact that all tags are closed
    But if you forget an end tag that is optional in HTML, you won't be told unless you validate. Whereas if you serve your XHTML as real XHTML, you'll immediately get a well-formedness error and the browser aborts the attempt to load the page.

    Also, if you serve the document as text/html, you can only use the fake NET syntax for elements that are declared as EMPTY in the DTD. You can't write <br></br> or <div/>, both of which are valid XHTML.

    Quote Originally Posted by znebojsa View Post
    and because the html validator will pick up some things when you give it HTML, which it won't when you give it HTML. eg, forgetting to close your <p>
    But it will still work if you serve it as text/html, because you're really using HTML (albeit invalid HTML). The </p> end tag is completely unnecessary; an HTML or SGML parser can infer its existence. The only reason to write it out is to make it more clear to human readers.

    HTML isn't less strict than XHTML. Valid HTML can be parsed unambiguously, even if you omit all optional tags. Those tags are really just fluff that makes the document easier to read for a human being. They are not necessary.

    The XML rules are more consistent and have less exceptions, and are marginally easier to learn. They also allow for simpler and (arguably) faster parsers, especially in combination with the requirement for draconian error handling. But do you really want draconian error handling for web pages? Especially web pages written by non-technical writers who couldn't care less about HTML vs XHTML?

    Using the subset of XHTML 1.0 specified in Appendix C, serving it as text/html is fine. Pointless, but fine. As long as it still works when served as, e.g., application/xhtml+xml.
    Birnam wood is come to Dunsinane

  17. #167
    SitePoint Addict
    Join Date
    Jun 2007
    Location
    Sydney, Australia
    Posts
    253
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    Using the subset of XHTML 1.0 specified in Appendix C, serving it as text/html is fine. Pointless, but fine. As long as it still works when served as, e.g., application/xhtml+xml.
    What do I need to do to ensure it works when served as application/xhtml+xml ?

  18. #168
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try serving it as application/xhtml+xml and viewing it in a browser that supports XHTML (Opera or Firefox; Safari has some odd quirks about XHTML).
    Birnam wood is come to Dunsinane

  19. #169
    SitePoint Addict
    Join Date
    Jun 2007
    Location
    Sydney, Australia
    Posts
    253
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So is this all I have to do?

    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=ISO-8859-1" />

  20. #170
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, please read the first post in this FAQ. You can't change the content type from within the content, because it needs to be known beforehand. The user agent must be able to choose between its HTML parser or XML parser before it reads a single byte of the response body.

    You need to make the server send the appropriate HTTP Content-Type header. For a single static page you can test it from your hard drive by changing the filename suffix to .xhtml or .xml. Both Opera and Firefox will use their XML parsers for these suffixes.
    Birnam wood is come to Dunsinane

  21. #171
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    The XML rules are more consistent and have less exceptions, and are marginally easier to learn. They also allow for simpler and (arguably) faster parsers, especially in combination with the requirement for draconian error handling.
    http://hsivonen.iki.fi/cost-of-html/
    Simon Pieters

  22. #172
    SitePoint Addict
    Join Date
    Jun 2007
    Location
    Sydney, Australia
    Posts
    253
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    Try serving it as application/xhtml+xml and viewing it in a browser that supports XHTML (Opera or Firefox; Safari has some odd quirks about XHTML).
    Ok, yes it seems to work fine when I serve it as application/xhtml+xml. But I didn't know that serving XHTML 1.0 as HTML is actually invalid code... So I think I'll stick with HTML.

  23. #173
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's probably the best choice, unless you really need (real) XHTML. For instance, if you need to embed MathML equations or SVG graphics directly into your document. (You can do it with HTML, too, indirectly, by using object.)
    Birnam wood is come to Dunsinane

  24. #174
    SitePoint Guru cyjetsu's Avatar
    Join Date
    May 2008
    Posts
    814
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It seems to me that it would be best to validate code with an xhtml strict dtd to get rid of as many errors as possible(apart from closing tag on empty elements). Then validate it with html strict dtd, and keep that.

    Reason for validating with xhtml dtd first is becuase html strict validation allows more errors to go by without warning you. I think.

  25. #175
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    That's not true. The HTML validator is just a strict as the XHTML one, however HTML as a language does not require tags which are superfluous to the proper understanding of the semantics of the document. For example, the code below is fully valid HTML 4.01 Strict, and can only be interpreted in one way.

    Code html4strict:
    <p>...
    <ul>
      <li>...
      <li>...
    </ul>
    <table>
      <thead>
        <tr>
          <th>...
          <th>...
      <tbody>
        <tr>
          <td>...
          <td>...
        <tr>
          <td>...
          <td>...
    </table>
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!


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
  •