SitePoint Sponsor

User Tag List

Page 2 of 9 FirstFirst 123456 ... LastLast
Results 26 to 50 of 215
  1. #26
    SitePoint Zealot spinball's Avatar
    Join Date
    Oct 2004
    Location
    Harrison Twp., MI
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Even valid HTML allows you to use deprecated tags. Why would you use something that's no longer valid in the most recent language. I don't understand what the discussion is here. The W3C has recommended using valid XHTML since 1999. HTML is an old deprecated language whether it validates or not.

    I don't know of anyone developing XML right now to work nicely with HTML. XHTML is not much different than good HTML mark-up, so use the best.

  2. #27
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you think that XHTML is HTML that looks like XML, which most "XHTML" authors seem to do, you will write things that only works for HTML. As long as your "XHTML" document is served as text/html, you won't notice the difference, because it is, in fact, HTML as far as the user agent is concerned.

    This allows you to keep "forgetting" to use lowercase element and attribute names; to "forget" quoting attribute values; to "forget" well-formedness; to "hide" script code and CSS rules within SGML comments; to use old-skool JavaScript like document.write() to dynamically modify the document during the parsing phase; to use uppercase element type selectors in your CSS.

    None of those things will work if the document is served as proper XHTML.

    If you instead realise that XHTML is XML that happens to look a lot like HTML, you will know that you have to treat it as XML in every way. Even if you are forced to serve it as text/html at the moment, because too many users still insist on IE.

    I hope that answers both Jack's and Kravvitz's questions.
    Birnam wood is come to Dunsinane

  3. #28
    SitePoint Enthusiast m0n5t3r's Avatar
    Join Date
    Jul 2003
    Location
    Romania
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found sending XHTML as application/xhtml+xml to browsers that support it to be very helpful, because the browser's xml parser checks the code for well-formedness and tells me where the typo(s) is(are)
    m0n5t3r's nest
    --
    earth is 98% full ... please delete anyone you can.

  4. #29
    SitePoint Addict myrdhrin's Avatar
    Join Date
    Jul 2004
    Location
    Montreal
    Posts
    211
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Kravvitz
    How is SGML more complicated than XML, other than the case insensitivity and the optional end tags of SGML?
    SGML is more complex as it is more generic than XML. XML is derived from SGML as a subset of it's functionality. HTML is an SGML specification xHTML is a XML specification.

    Provided the right DTD the following could be a valid SGML document:

    Code:
    name:myrdhrin
    favoritesite:sitepoint.com
    logo:fjoicejr89p348jcm4893m984m8p94fjm2894jmfc8349jcm8pj23m98crf498mr389pcmf84jfm8439fmjc
    It does not look anything like an XML document but it has enough markup in it (the CRLF and the tag names) to be parsed by a computer.
    Jean-Marc (aka Myrdhrin)
    M2i3 - blog - Protect your privacy with Zliki

  5. #30
    SitePoint Wizard silver trophy Karl's Avatar
    Join Date
    Jul 1999
    Location
    Derbyshire, UK
    Posts
    4,411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just tried a site I've been coding in XHTML1.1. Works very well in FireFox, with the application/xhtml+xml content type, however IE just barfs and won't load the page. The only things that stopped working when I changed the content type with FireFox was an external JS (Which uses document.write() ) - Which is for livechat and the link colourings/hovers etc. stopped.
    Karl Austin :: Profile :: KDA Web Services Ltd.
    Business Web Hosting :: Managed Dedicated Hosting
    Call 0800 542 9764 today and ask how we can help your business grow.

  6. #31
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IE doesn't support application/xhtml+xml, which is why most "XHTML" sites are served as text/html – i.e. as HTML.

    document.write() doesn't work in X(HT)ML, but if CSS-based link colouring or hovers stopped working, you must have some error in your CSS. Make sure you haven't written 'A:hover' instead of 'a:hover', since element type selectors are case-sensitive when CSS is used with real XHTML.
    Birnam wood is come to Dunsinane

  7. #32
    SitePoint Wizard silver trophy Karl's Avatar
    Join Date
    Jul 1999
    Location
    Derbyshire, UK
    Posts
    4,411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Hah, that was indeed the problem, I'd copied some of the CSS from the original design done by the designer, not noticing they were A and not a in the CSS. Original code was horrible 28k HTML page (Done in FrontPage), now it's an 11k front page, with a 13k CSS used on every page.

    Thanks,
    Karl Austin :: Profile :: KDA Web Services Ltd.
    Business Web Hosting :: Managed Dedicated Hosting
    Call 0800 542 9764 today and ask how we can help your business grow.

  8. #33
    SitePoint Guru OfficeOfTheLaw's Avatar
    Join Date
    Apr 2004
    Location
    Quincy
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BluDragon
    Yeah that should like somewhat like this (from my site):
    [

    As for the mime type, you can do this:
    Code:
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    Joe
    For xhtml strict? NO. XHTML strict MUST be sent as application/xhtml+xml, it cannot be sent as text/html. I would avoid using application/xhtml+xml and xhtml 1.0 because IE doesnt really grok it... it just sees it as tag soup.

    In my opinion, you should just use html 4.01 strict, and if you must, use xhtml 1.0 transitional. I have rarely seen any sites out there using xhtml that really had a need for it. ALOT of sites use xhtml 1.1 doctypes with a little xhtml 1.1 complaint icon slapped on it, when (a) it isn't sent with the correct mimetype, (b) contains about 30 validation errors, unencoded ampersands, etc, and (c) does absolutely nothing special that benefits from using xhtml 1.1.

    However, I have seen a site that used it rather intelligently, integrating MathML and SVG into the site. Talk about special interest!

    James Carr, Software Engineer


    assertEquals(newXPJob, you.ask(officeOfTheLaw));

  9. #34
    ~unplugged Ainslie X11's Avatar
    Join Date
    Feb 2005
    Location
    Langley, Virginia
    Posts
    1,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sassou
    Valid HTML 4 here ! what is the difference really ? any advantages of XHTML ?
    I use HTML4 & CSS for my pages would it be better to use XHTML/CSS ?
    Nah! It's better to wallow in the microsoft troff and focus on valid clean 4.01 and css.

    As a designer, it's difficult enough evolving client's aesthetic visions into valid, cross browser/platform, html and css. I had to incorporate a feedroll script in one site I just finished, and for 'fun' I converted it to xhtml. Everything validated except the feedroll script. I don't get paid extra to rewrite other peoples scripts that don't validate, and if they're not going to make xhtml valid scripts available... why should I bother.

    If there's something you can't do in 4 that absolutely needs to be done in xhtml (someone name something), then pull out the books. Otherwise, stick with the tried and true as most xhtml sites I've come across, especially ones beyond a few lines of code, just don't validate.

    If the web's already full of invalid html, why clutter it up even more so with copious invalid and even harder to clean up xhtml sites?

    As far as I'm concerned, most of the xhtml I've come across is simply mutton dressed up as lamb because some people just press the 'convert to xhtml' button in dreamweaver and think their doggy code get magically transformed into clean valid xhtml.

    Even sitepoint doesn't validate dare I say it, the w3.org validator spat out 28 errors!

  10. #35
    SitePoint Zealot
    Join Date
    Oct 2001
    Location
    Norway
    Posts
    187
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by zcorpan
    These trigger Almost Standards Mode in Gecko:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
     "http://www.w3.org/TR/html4/loose.dtd">
    These trigger Full Standards Mode in Gecko:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
    Interesting. I had a feeling that it's not as simple as standards or quirks mode. Are the differences between full standards and almost standards mode documented somewhere?
    Good web hosting info All you need to know about web hosting
    xhbml(web dev blog)
    CSS Viking CSS blog

  11. #36
    SitePoint Evangelist
    Join Date
    Feb 2005
    Posts
    581
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by OfficeOfTheLaw
    For xhtml strict? NO. XHTML strict MUST be sent as application/xhtml+xml, it cannot be sent as text/html. I would avoid using application/xhtml+xml and xhtml 1.0 because IE doesnt really grok it... it just sees it as tag soup.
    Ok, that was just an example taken from another page on my site. MEANT FOR DEMONSTRATION PURPOSES ONLY!

    Guess I should start adding disclaimers.

    P.S. I've always used "application/xhtml+xml" with no problems from IE.

    Joe

  12. #37
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.mozilla.org/docs/web-developer/quirks/

    Almost Standards Mode is by and far the same as Full Standards Mode, with one exeption: Images in table cells.
    Simon Pieters

  13. #38
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For xhtml strict? NO. XHTML strict MUST be sent as application/xhtml+xml, it cannot be sent as text/html.
    XHTML 1.0 may be served as text/html if it follows the compability guidelines in Appendix C. It doesn't matter if it is Transitional, Frameset or Strict. (Although it still SHOULD be served as application/xhtml+xml.)

    XHTML 1.1, however, should not be served as text/html because it not compatible with HTML (and wasn't intended to be).
    Simon Pieters

  14. #39
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    Melbourne
    Posts
    362
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BluDragon
    Ok, that was just an example taken from another page on my site. MEANT FOR DEMONSTRATION PURPOSES ONLY!

    Guess I should start adding disclaimers.

    P.S. I've always used "application/xhtml+xml" with no problems from IE.

    Joe
    You sure about that? As far as I've ever experienced IE just prompts you to download the page, unless you hack some registry stuff http://sastools.com/b2/post/79394232 . Did something change in the last few months about IE's application/xhtml+xml support?

  15. #40
    SitePoint Evangelist
    Join Date
    Feb 2005
    Posts
    581
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Take a look-see:

  16. #41
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by spinball
    Even valid HTML allows you to use deprecated tags.
    HTML 4.01 and XHTML 1.0 both allow the same tags.

    HTML 4.01 and XHTML 1.0 both have a seperate "Strict" and "Transitional" variant. The "Transitional" variant in both is for compatibility with presentational markup (which may be called 'deprecated'), such as that available in HTML 3.2. The "Strict" variant in both HTML 4.01 and XHTML 1.0 represents the current recommended method of applying presentation to documents, and is encouraged for forward compatibility.
    Why would you use something that's no longer valid in the most recent language.
    XHTML 1.0 and HTML 4.01 are equivalent to each other, and they are the same age. Neither is more advanced than the other, or more sophisticated than the other, other than the underlying syntax. Think of HTML 4.01 and XHTML 1.0 as one language that happens to be available in two flavours: SGML and XML.

    The W3C has recommended using valid XHTML since 1999
    The W3C has also recommended using HTML 4.01 since 1999. That is, HTML 4.01 is a current W3C recommendation.
    HTML is an old deprecated language whether it validates or not.
    HTML 4.01 is not in any way deprecated. It is the latest version of HTML available, it is still a current W3C recommendation and is in widespread use and well supported by all modern browsers. By contrast, XHTML is not in such widespread use and is not well supported by browsers yet. For example, Microsoft's Internet Explorer does not have any support for XHTML at all and treats all XHTML as if it is HTML 4.01.
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog Twitter Contact me
    Neon Javascript Framework Jokes Android stuff

  17. #42

  18. #43
    SitePoint Guru OfficeOfTheLaw's Avatar
    Join Date
    Apr 2004
    Location
    Quincy
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Tanus
    Did something change in the last few months about IE's application/xhtml+xml support?
    Nah, don't think so... if there was, there'd be quite a stir in the web design blogsphere over it... rather than numerous posts out there stating that the current rumor is that IE7 still won't support application/xhtml+xml.

    And even if something did change recently, it's still risky as it is more than unlikely that more than perhaps 3% IE users at best would have the ability to view pages served as application/xhtml+xml .

    James Carr, Software Engineer


    assertEquals(newXPJob, you.ask(officeOfTheLaw));

  19. #44
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can tweak the Windows registry to make IE accept application/xhtml+xml (rather than attempting to download it). That doesn't mean it supports it, though. It will still handle it as HTML.
    Birnam wood is come to Dunsinane

  20. #45
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Edit: AutisticCuckoo (above) beat me to this point while I was writing this

    Quote Originally Posted by OfficeOfTheLaw
    rather than numerous posts out there stating that the current rumor is that IE7 still won't support application/xhtml+xml.
    In my eyes, the problem with IE is not that it doesn't support the application/xhtml+xml content type - it is that it doesn't support XHTML at all.

    There are registry hacks (and an XSLT hack) available which allow IE to parse application/xhtml+xml as HTML. But IE still won't treat it as XHTML because IE has no XHTML support.

    For example, the following is valid in XHTML:
    Code:
    <script type="text/javascript">
    <!-- This is my script -->
    <![CDATA[
    
    alert('Hello world');
    
    ]]>
    </script>
    Now try THAT in a browser which doesn't support XHTML.
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog Twitter Contact me
    Neon Javascript Framework Jokes Android stuff

  21. #46
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is an interesting discusson of XHTML. I've been using XHTML 1.0 transitional since 2000 and never heard about the mime issue.

    Is there any real value or need to use the language and xml properties in the HTML tag?

    <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">

    I've never used it and have never seen a problem with either page rendering or W3C validation. I do, however, always add the meta tag language and character set declarations.

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <meta http-equiv="Content-Language" content="en-us" />

    Is there any value to using the meta tags if I use the XML version of the HTML tag?

  22. #47
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    The lang and xml:lang attributes help in many ways, especially with accessibility.

    More info: http://diveintoaccessibility.org/day..._language.html

  23. #48
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You CAN NOT change the charset with a META element when serving XML (it has no effect what so ever). That means that if you don't specify the charset in the HTTP header or the XML declaration you rely on HTML parsing (unless you use UTF-8, which XML defaults to).
    Simon Pieters

  24. #49
    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 Tech Evangelist
    I've been using XHTML 1.0 transitional since 2000 and never heard about the mime issue.
    I'm sorry to disappoint you, but then you haven't been using XHTML at all. You have just been using HTML with errors in it.

    Quote Originally Posted by Tech Evangelist
    Is there any real value or need to use the language and xml properties in the HTML tag?

    <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
    The XML namespace is necessary to inform user agents that this is XHTML (the doctype declaration has nothing to do with that; you can use XHTML without a doctype). The language attributes, as Vinnie said, are important for accessibility (and for search engines).

    Quote Originally Posted by Tech Evangelist
    I've never used it and have never seen a problem with either page rendering or W3C validation.
    The doctype declaration tells the W3C validator to check your markup according to the rules of XHTML, so that's no problem. And there's no problem in browsers, either, because you're serving them HTML and that's what they are built to render. Due to browser error handling, and some SGML-related bugs, they will accept your incorrect HTML markup and render it.

    Quote Originally Posted by Tech Evangelist
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    This is pointless. You cannot change the content type through a META element, because the user agent needs to know it before it starts parsing. It must go in a real HTTP header. As zcorpan said, you can't change the character encoding this way, either. For X(HT)ML, that should be declared in the XML declaration:
    HTML Code:
    <?xml version="1.0" encoding="utf-8"?>
    Birnam wood is come to Dunsinane

  25. #50
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the info. This is interesting. I read dozens of tutorials before I started working with XHTML and NONE stressed any of this.

    I did notice something curious. These are the first lines of code in this forum page:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html dir="ltr" lang="en">
    <head>
    <title>SitePoint Forums - Use XHTML or HTML 4.01 Doctype?</title>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />


    It looks like there is some pointless code in the script for this forum. Other than the attributes added to the HTML tag, the code used for this forum page is the same as what I've been using.

    I'm not doubting what you are saying, but if I am following you correctly, the first lines of code in an XML 1.0 document should look like the following. Please verify and corect me if I'm wrong.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <?xml version="1.0" encoding="utf-8"?>

    Is this the correct order? Am I missing anything?


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
  •