question xhtml transitional or strict !?

Discussion in 'HTML' started by t, Feb 19, 2008.

  1. t

    t Guest

    hay,
    i am reading about xtml, and don't know which one is better
    transitional or strict !?
    which one you use when writting code in xthml, i am little
    confused about dicision?

    tnx
    t, Feb 19, 2008
    #1
    1. Advertising

  2. t

    Guest

    On Feb 19, 4:36 pm, t wrote:
    > hay,
    > i am reading about xtml, and don't know which one is better
    > transitional or strict !?
    > which one you use when writting code in xthml, i am little
    > confused about dicision?
    >
    > tnx


    Better use XHTML strict, you have a better chance
    for the page to be displayed as intended in most browsers.

    Also valid XHTML strict does not include the target
    attribute of <a> tags, usually used to open links in new tabs,
    and this is a good accessibility feature.

    Check valid XHTML mark-up with the W3C validator
    http://validator.w3.org/

    For differences between strict and transitional have a look at
    http://en.wikipedia.org/wiki/HTML#Transitional_versus_Strict
    , Feb 19, 2008
    #2
    1. Advertising

  3. wrote:

    > On Feb 19, 4:36 pm, t wrote:
    >> hay,
    >> i am reading about xtml, and don't know which one is better
    >> transitional or strict !? which one you use when writting code in
    >> xthml, i am little confused about dicision?

    >
    > Better use XHTML strict, you have a better chance
    > for the page to be displayed as intended in most browsers.


    ...except most Internet Explorer browsers, unless you cheat and serve it
    as "text/html" instead of the correct "application/xhtml+xml"

    Unless you know exactly why you think you need XHTML, use HTML 4.01
    Strict.

    Transitional (either HTML or XHTML) is for working with old legacy
    pages, and not new ones. New pages should be Strict.

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">

    Here's a test page, first as properly served XHTML. Try it with IE.
    http://fingerlakesbmw.org/test/xhtml.php
    and the companion HTML page,
    http://fingerlakesbmw.org/test/html.php

    --
    -bts
    -Motorcycles defy gravity; cars just suck
    Beauregard T. Shagnasty, Feb 19, 2008
    #3
  4. ..oO(t)

    >i am reading about xtml, and don't know which one is better
    >transitional or strict !?
    >which one you use when writting code in xthml, i am little
    >confused about dicision?


    For new sites always Strict. But you should consider to use HTML 4.01
    Strict instead, there's little point in using XHTML these days.

    Micha
    Michael Fesser, Feb 19, 2008
    #4
  5. Oh, and this:

    wrote:

    > Also valid XHTML strict does not include the target attribute of <a>
    > tags, usually used to open links in new tabs, and this is a good
    > accessibility feature.


    No, it is certainly not a "good accessibility feature" especially for
    visitors who have maximized browser windows.

    Why don't you let me decide where I want to open links?

    --
    -bts
    -Motorcycles defy gravity; cars just suck
    Beauregard T. Shagnasty, Feb 19, 2008
    #5
  6. t

    Guest

    On Feb 19, 5:28 pm, "Beauregard T. Shagnasty" wrote:
    > ..except most Internet Explorer browsers, unless you cheat and serve it
    > as "text/html" instead of the correct "application/xhtml+xml"


    It is obvious that logic fails in discussing this one somehow.
    I meant a text/html document starting
    with the XHTML doctype declaration.

    > Unless you know exactly why you think you need XHTML, use HTML 4.01
    > Strict.


    I think it is better to use XHTML than HTML because

    - it is better for mark-up validation tools,
    HTML and CSS validators work better for XHTML,
    they follow more consistent rules than for HTML.
    The same probably goes for parsers of search engines,
    and for some web accessibility tools.

    - XHTML is needed for example when using Google Maps with polylines.
    Why change to XHTML from HTML if deciding later to include
    things which need XHTML, when it is easier to start with the XHTML
    mark-up.
    , Feb 19, 2008
    #6
  7. t

    Guest

    On Feb 19, 5:31 pm, "Beauregard T. Shagnasty" wrote:
    > Oh, and this:
    > :
    > > Also valid XHTML strict does not include the target attribute of <a>
    > > tags, usually used to open links in new tabs, and this is a good
    > > accessibility feature.

    >
    > No, it is certainly not a "good accessibility feature" especially for
    > visitors who have maximized browser windows.
    >
    > Why don't you let me decide where I want to open links?



    Sorry, I meant Strict is good in not validating the
    target attribute for links, so not to open links
    in new tabs by using the target attribute.
    Strict good, transitional bad.
    , Feb 19, 2008
    #7
  8. ..oO()

    >On Feb 19, 5:28 pm, "Beauregard T. Shagnasty" wrote:
    >> ..except most Internet Explorer browsers, unless you cheat and serve it
    >> as "text/html" instead of the correct "application/xhtml+xml"

    >
    >It is obvious that logic fails in discussing this one somehow.
    >I meant a text/html document starting
    >with the XHTML doctype declaration.


    Then it is no real XHTML, but pseudo-XHTML written in an HTML-compatible
    way, declared and served as HTML for being handled and rendered as HTML
    by an HTML tag soup parser. Pretty pointless IMHO.

    >> Unless you know exactly why you think you need XHTML, use HTML 4.01
    >> Strict.

    >
    >I think it is better to use XHTML than HTML because
    >
    >- it is better for mark-up validation tools,
    > HTML and CSS validators work better for XHTML,


    CSS has nothing to do with the markup. Additionally for XHTML you need a
    special schema validator, not an SGML-based one like the W3 validator.

    > they follow more consistent rules than for HTML.


    XML enforces a stricter syntax, but you can use the same strictness in
    HTML (lower-case tag names, always quoted attributes, well-formedness,
    no optional tags etc.)

    > The same probably goes for parsers of search engines,
    > and for some web accessibility tools.
    >
    >- XHTML is needed for example when using Google Maps with polylines.
    > Why change to XHTML from HTML if deciding later to include
    > things which need XHTML, when it is easier to start with the XHTML
    >mark-up.


    * Real XHTML doesn't work in IE.
    * It's pretty easy to switch from clean HTML to XHTML if it should ever
    become necessary (can be done almost automatically).
    * If there will ever be an XHTML 2.0, it will _not_ be backwards-
    compatible with the current XHTML standards, hence XHTML 1.0 and 1.1
    can be seen as a dead end road.
    * They're working on HTML 5 already ...

    Micha
    Michael Fesser, Feb 19, 2008
    #8
  9. wrote:
    > On Feb 19, 5:31 pm, "Beauregard T. Shagnasty" wrote:
    >> Oh, and this:
    >> :
    >>> Also valid XHTML strict does not include the target attribute of <a>
    >>> tags, usually used to open links in new tabs, and this is a good
    >>> accessibility feature.

    >> No, it is certainly not a "good accessibility feature" especially for
    >> visitors who have maximized browser windows.
    >>
    >> Why don't you let me decide where I want to open links?

    >
    >
    > Sorry, I meant Strict is good in not validating the
    > target attribute for links, so not to open links
    > in new tabs by using the target attribute.
    > Strict good, transitional bad.


    Well yes strict is best for new documents, where you are mistaken is in
    believing xhtml is somehow better than html for webpage design. Most
    sites do not the features that xml would bring to it and will only cause
    trouble with deployment because MS refuses to support it in their browsers.

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Feb 19, 2008
    #9
  10. wrote:

    > Beauregard T. Shagnasty wrote:
    >> ..except most Internet Explorer browsers, unless you cheat and serve
    >> it as "text/html" instead of the correct "application/xhtml+xml"

    >
    > It is obvious that logic fails in discussing this one somehow. I
    > meant a text/html document starting with the XHTML doctype
    > declaration.


    Then you are not writing XHTML, so why be a fake?

    >> Unless you know exactly why you think you need XHTML, use HTML 4.01
    >> Strict.

    >
    > I think it is better to use XHTML than HTML because
    >
    > - it is better for mark-up validation tools,
    > HTML and CSS validators work better for XHTML,
    > they follow more consistent rules than for HTML.
    > The same probably goes for parsers of search engines,
    > and for some web accessibility tools.
    >
    > - XHTML is needed for example when using Google Maps with polylines.
    > Why change to XHTML from HTML if deciding later to include
    > things which need XHTML, when it is easier to start with the XHTML
    > mark-up.


    Except for perhaps that Google Maps thing (I don't use it), none of your
    arguments are correct.

    I can't at this moment think of any "things which need XHTML."

    --
    -bts
    -Friends don't let friends drive Vista
    Beauregard T. Shagnasty, Feb 19, 2008
    #10
  11. t

    Andy Dingley Guest

    On 19 Feb, 16:36, t <> wrote:

    > i am reading about xtml, and don't know which one is better
    > transitional or strict !?


    Use HTML 4.01 Strict

    If you don't want to do this, please explain your reason (and make it
    a good one!)

    There are two separate issues here: HTML vs. XHTML and _separately_
    Strict vs. Transitional.
    For both questions, the answer is HTML 4.01 Strict unless you have a
    really good reason not to.
    Andy Dingley, Feb 19, 2008
    #11
  12. t

    Guest

    On Feb 19, 6:19 pm, Michael Fesser wrote:

    > CSS has nothing to do with the markup.


    I think it is obvious in what I wrote
    that I assumed that everybody
    knows what CSS is, meaning
    HTML mark-up is HTML mark-up and
    CSS is.. CSS, not HTML mark-up.
    , Feb 19, 2008
    #12
  13. ..oO()

    >On Feb 19, 6:19 pm, Michael Fesser wrote:
    >
    >> CSS has nothing to do with the markup.

    >
    >I think it is obvious in what I wrote
    >that I assumed that everybody
    >knows what CSS is, meaning
    >HTML mark-up is HTML mark-up and
    >CSS is.. CSS, not HTML mark-up.


    Then please explain:

    | [...] CSS validators work better for XHTML

    Micha
    Michael Fesser, Feb 19, 2008
    #13
  14. t

    Guest

    On Feb 19, 7:36 pm, Michael Fesser wrote:

    > Then please explain:
    >
    > | [...] CSS validators work better for XHTML
    >
    > Micha


    CSS validators (example the W3C CSS validator)
    extract style information (inline or from the <style> element in
    <head>)
    and URLs of external style sheet files from the source of
    the (X)HTML file,
    CSS validators recognize an XHTML (or HTML) doctype
    and parse the XHTML (or HTML) source accordingly.
    It is easier to parse a valid XHTML Strict document
    than an HTML document because there are more relevant rules
    followed by a document with the XHTML doctype.
    , Feb 19, 2008
    #14
  15. t

    C A Upsdell Guest

    t wrote:
    > hay,
    > i am reading about xtml, and don't know which one is better
    > transitional or strict !?
    > which one you use when writting code in xthml, i am little
    > confused about dicision?


    One thing you may wish to consider is that XHTML is stricter than HTML,
    which MIGHT be helpful while you are learning. For example, if you
    validate an XHTML file, it will complain if end tags are missing: if
    you validate an HTML file, it will not complain about this.

    Using XHTML Strict is better than XHTML Transitional for learning, again
    because the validator will warn you if you use depecated features, which
    you really should not use.

    (An alternative is to use HTML 4.01 Strict with some tool which tells
    you about coding problems.)

    When building real sites, however, you may want to revisit this issue:
    as many have pointed out, there are good reasons for using HTML 4.01
    Strict instead of XHTML Strict ... for real websites.
    C A Upsdell, Feb 19, 2008
    #15
  16. t

    Neredbojias Guest

    Well bust mah britches and call me cheeky, on Tue, 19 Feb 2008 18:19:03
    GMT Michael Fesser scribed:

    >>- it is better for mark-up validation tools,
    >> HTML and CSS validators work better for XHTML,

    >
    > CSS has nothing to do with the markup. Additionally for XHTML you need
    > a special schema validator, not an SGML-based one like the W3
    > validator.


    Yep, and the w3c validator doesn't accept the application/xhtml+xml
    header.

    >> they follow more consistent rules than for HTML.

    >
    > XML enforces a stricter syntax, but you can use the same strictness in
    > HTML (lower-case tag names, always quoted attributes, well-formedness,
    > no optional tags etc.)
    >
    >> The same probably goes for parsers of search engines,
    >> and for some web accessibility tools.
    >>
    >>- XHTML is needed for example when using Google Maps with polylines.
    >> Why change to XHTML from HTML if deciding later to include
    >> things which need XHTML, when it is easier to start with the XHTML
    >>mark-up.

    >
    > * Real XHTML doesn't work in IE.
    > * It's pretty easy to switch from clean HTML to XHTML if it should
    > ever
    > become necessary (can be done almost automatically).
    > * If there will ever be an XHTML 2.0, it will _not_ be backwards-
    > compatible with the current XHTML standards, hence XHTML 1.0 and 1.1
    > can be seen as a dead end road.


    Yep. I've already done some testing on xhtml 2.0 online. You can
    download the X-smiles browser which is partially (somewhat primitively)
    xhtml 2.0 compatible. FWIW, the new links/href techniques are terrific
    (in my opinion), and there are other improvements. Xthml 1.0 and 1.1
    are already obsolete. Backward-compatibility is not beneficial when it
    extends compatibility to what is basically crap anyway.

    > * They're working on HTML 5 already ...


    Great, but to reiterate what has already been stated, for _today's_ web
    page, html 4.01 strict is the only thing that makes good sense.

    --
    Neredbojias
    http://www.neredbojias.com/
    Great sights and sounds
    Neredbojias, Feb 19, 2008
    #16
  17. Neredbojias wrote:

    > Michael Fesser scribed:
    >> CSS has nothing to do with the markup. Additionally for XHTML you
    >> need a special schema validator, not an SGML-based one like the W3
    >> validator.

    >
    > Yep, and the w3c validator doesn't accept the application/xhtml+xml
    > header.


    Are you sure?

    <http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.fingerlakesbmw.org%2Ftest%2Fxhtml.php>

    "Content-Type: application/xhtml+xml"

    --
    -bts
    -Friends don't let friends drive Vista
    Beauregard T. Shagnasty, Feb 19, 2008
    #17
  18. C A Upsdell wrote:
    > t wrote:
    >> hay,
    >> i am reading about xtml, and don't know which one is better
    >> transitional or strict !?
    >> which one you use when writting code in xthml, i am little
    >> confused about dicision?

    >
    > One thing you may wish to consider is that XHTML is stricter than HTML,
    > which MIGHT be helpful while you are learning.


    Not if in real-world application you would be using *html*

    > For example, if you
    > validate an XHTML file, it will complain if end tags are missing: if
    > you validate an HTML file, it will not complain about this.


    Only for elements where the closing tag is optional. If yhey are
    optional then it *is* valid markup.

    >
    > Using XHTML Strict is better than XHTML Transitional for learning, again
    > because the validator will warn you if you use depecated features, which
    > you really should not use.


    It warns you for deprecated elements for HTML 4.01 Strict as well. No
    advantage there.

    >
    > (An alternative is to use HTML 4.01 Strict with some tool which tells
    > you about coding problems.)
    >
    > When building real sites, however, you may want to revisit this issue:
    > as many have pointed out, there are good reasons for using HTML 4.01
    > Strict instead of XHTML Strict ... for real websites.


    Such as if done *properly* poor folks who insist on using IE get a
    download box.


    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Feb 19, 2008
    #18
  19. t

    Neredbojias Guest

    Well bust mah britches and call me cheeky, on Tue, 19 Feb 2008 22:18:16
    GMT Beauregard T. Shagnasty scribed:

    > Neredbojias wrote:
    >
    >> Michael Fesser scribed:
    >>> CSS has nothing to do with the markup. Additionally for XHTML you
    >>> need a special schema validator, not an SGML-based one like the W3
    >>> validator.

    >>
    >> Yep, and the w3c validator doesn't accept the application/xhtml+xml
    >> header.

    >
    > Are you sure?
    >
    > <http://validator.w3.org/check?verbose=1&uri=http://www.fingerlak
    > esbmw.org%2Ftest%2Fxhtml.php>
    >
    > "Content-Type: application/xhtml+xml"


    Yes, that's what it says, and I think it means the tested page is so
    designated. But the _validator page_ is text/html.

    Now check "Page Info" (right-click context) in Firefox and see what
    content-type is actually rendered (for the validator).

    --
    Neredbojias
    http://www.neredbojias.com/
    Great sights and sounds
    Neredbojias, Feb 19, 2008
    #19
  20. Neredbojias wrote:

    > Beauregard T. Shagnasty scribed:
    >> Neredbojias wrote:
    >>> Michael Fesser scribed:
    >>>> CSS has nothing to do with the markup. Additionally for XHTML you
    >>>> need a special schema validator, not an SGML-based one like the W3
    >>>> validator.
    >>>
    >>> Yep, and the w3c validator doesn't accept the application/xhtml+xml
    >>> header.

    >>
    >> Are you sure?
    >>
    >> <http://validator.w3.org/check?verbose=1&uri=http://www.fingerlak
    >> esbmw.org%2Ftest%2Fxhtml.php>
    >>
    >> "Content-Type: application/xhtml+xml"

    >
    > Yes, that's what it says, and I think it means the tested page is so
    > designated. But the _validator page_ is text/html.


    Sure. As it should be. It is not a good idea to use
    application/xhtml+xml on the web.

    > Now check "Page Info" (right-click context) in Firefox and see what
    > content-type is actually rendered (for the validator).


    The validator sends as "text/html" as it should. How is that relevant?
    You said, "the w3c validator doesn't *accept* the application/xhtml+xml
    header." [emphasis mine], which I was rightly disputing.

    --
    -bts
    -Friends don't let friends drive Vista
    Beauregard T. Shagnasty, Feb 20, 2008
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave Winter
    Replies:
    16
    Views:
    1,147
    Steve Pugh
    Apr 27, 2004
  2. mark | r

    strict/transitional Q's

    mark | r, May 10, 2004, in forum: HTML
    Replies:
    11
    Views:
    853
    Spartanicus
    May 10, 2004
  3. Sally Thompson
    Replies:
    10
    Views:
    6,209
    Sally Thompson
    Jun 26, 2004
  4. BessieBee

    HTML transitional vs strict

    BessieBee, Apr 10, 2008, in forum: HTML
    Replies:
    3
    Views:
    640
    Jukka K. Korpela
    Apr 10, 2008
  5. Beauregard T. Shagnasty

    Re: Converting transitional to strict

    Beauregard T. Shagnasty, May 16, 2010, in forum: HTML
    Replies:
    3
    Views:
    530
    Jukka K. Korpela
    May 17, 2010
Loading...

Share This Page