XHTML strict

Discussion in 'HTML' started by Jure Erznoznik, Apr 19, 2005.

  1. I've decided to reprogram my WEB app to XHTML for some of the benefits
    described in W3C documentation.
    While studying the documentation, I noticed a particular line which said
    somethink like: If you wish to separate data from presentation, use strict,
    otherwise use transitional.

    While my documents work just fine using strict, I'm not really separating
    data from presentation. The documents look almost exactly like they looked
    in HTML 4.0 transitional I used before.
    Q1: The way I understand it, to separate data from presentation, I would
    have to use XSLT, wouldn't I?
    I really don't want to do this since I have multiple data sets on each page.
    I like them separated in the code the way they currently are. I would also
    like to eventually support other browsers beside IE 6 and Firefox 1 I am
    currently testing for and I really don't think XSLT is the way to do that.

    Also, I'm having trouble with validator.w3.org:

    Q2: Since it is a multilanguage app, I have all the docs UTF-8 encoded.
    UTF-8 kinda requires 3 lead bytes to tell the reader how the file is
    encoded, but validator says (error in document) that I should avoid those 3
    bytes. I can of course do that, but then I would break UTF-8 rules!?!

    Q3: Additionally, I have a problem with tables: I made myself a JavaScript
    table object which allows me to interactively show SQL queries in HTML
    tables (through some XML / PHP / SOAP). Anyway, for this object to work
    correctly, I have to tell it each field's unique value, which I do through a
    <TR> attribute "uniqueid". (<tr uniqueid="xxx"><td........</tr>) Of course,
    the validator is not particulary happy about this attribute since it is
    unknown. Is there any other way to have this information in the table in a
    valid form?

    Thanks in advance,
    Jure
    Jure Erznoznik, Apr 19, 2005
    #1
    1. Advertising

  2. Jure Erznoznik

    Mitja Guest

    Zivjo :)

    > I've decided to reprogram my WEB app to XHTML for some of the benefits
    > described in W3C documentation.
    > While studying the documentation, I noticed a particular line which said
    > somethink like: If you wish to separate data from presentation, use
    > strict, otherwise use transitional.

    Perhaps the other way round: if you really don't want to / can't separate
    data and style, use transitional. If you want them separated, both
    transitional and strict will do, though. It's just that strict more or
    less of forces you to do it.

    > Q1: The way I understand it, to separate data from presentation, I would
    > have to use XSLT, wouldn't I?

    XSLT is a generic style markup language, used for generic XML. You use
    XHTML, which is a subset, so css is fine and preferred. (Hm... preffered?
    I'm not exactly at home with XML, but I think XSLT isn't even a proper
    substitute for CSS. What you can do with XSLT, AFAIK, is transform it into
    a (possibly CSS-enhanced) XHTML file).

    > Q2: Since it is a multilanguage app, I have all the docs UTF-8 encoded.
    > UTF-8 kinda requires 3 lead bytes to tell the reader how the file is
    > encoded, but validator says (error in document) that I should avoid
    > those 3 bytes. I can of course do that, but then I would break UTF-8
    > rules!?!

    Nope, the leading bytes (called byte order mark) are optional for UTF-8:
    http://www.unicode.org/faq/utf_bom.html#22

    > Q3: Additionally, I have a problem with tables: I made myself a
    > JavaScript table object which allows me to interactively show SQL
    > queries in HTML
    > tables (through some XML / PHP / SOAP). Anyway, for this object to work
    > correctly, I have to tell it each field's unique value, which I do
    > through a <TR> attribute "uniqueid". (<tr
    > uniqueid="xxx"><td........</tr>) Of course, the validator is not
    > particulary happy about this attribute since it is
    > unknown. Is there any other way to have this information in the table in
    > a valid form?

    Two ways: you can (a) write your own DTD which allows the uniqueid
    attribute or, much better, you can (b) use the standard id attribute, as
    in <tr id="foo">.

    HTH,
    Mitja
    Mitja, Apr 19, 2005
    #2
    1. Advertising

  3. Jure Erznoznik

    Spartanicus Guest

    "Jure Erznoznik" <> wrote:

    >I've decided to reprogram my WEB app to XHTML for some of the benefits
    >described in W3C documentation.


    Make sure you can distinguish the facts from the myths first:
    http://www.spartanicus.utvinternet.ie/no-xhtml.htm

    >While studying the documentation, I noticed a particular line which said
    >somethink like: If you wish to separate data from presentation, use strict,
    >otherwise use transitional.
    >
    >While my documents work just fine using strict, I'm not really separating
    >data from presentation. The documents look almost exactly like they looked
    >in HTML 4.0 transitional I used before.
    >Q1: The way I understand it, to separate data from presentation, I would
    >have to use XSLT, wouldn't I?


    First make sure that you use HTML to correctly structure and
    semantically mark up your documents, use CSS for all things
    presentational.

    >Also, I'm having trouble with validator.w3.org:
    >
    >Q2: Since it is a multilanguage app, I have all the docs UTF-8 encoded.
    >UTF-8 kinda requires 3 lead bytes to tell the reader how the file is
    >encoded


    Document encoding should be transmitted before the client starts to
    receive it, this should be done by sending out the http content-type
    header, example: "Content-Type: text/html; charset=utf-8".

    >Q3: Additionally, I have a problem with tables: I made myself a JavaScript
    >table object which allows me to interactively show SQL queries in HTML
    >tables (through some XML / PHP / SOAP).


    Javascript should never be relied upon, your solution will fail if js is
    not available or not enabled.

    --
    Spartanicus
    Spartanicus, Apr 19, 2005
    #3
  4. Zivjo }:))

    Q1: As I understand Spartanicus, it seems the data / presentation is meant
    in a sense of display properties eg. do everything in css. <table> tag is
    not ment as a presentation part, only width attribute is (talking generally,
    replace table(data) / width(presentation) with anything).
    XSLT is as you said (a transformation of XML to CSS enhanced XHTML). It was
    my poor understanding of data / presentation terms that lead to this entire
    question.

    Q2: Thanks. It's been long since I last read the standard.
    Q3: Maybe id attribute will really be fine. I was afraid to use it since it
    means quite a lot in the standard itself. I don't think writing my own DTD
    would be sane. But that raises another question of what to do when I need
    multiple such attributes...

    Thanks again,
    Jure

    "Mitja" <> wrote in message news:eek:pspg0vnltdob4us@ibis...
    > Zivjo :)
    >
    >> I've decided to reprogram my WEB app to XHTML for some of the benefits
    >> described in W3C documentation.
    >> While studying the documentation, I noticed a particular line which said
    >> somethink like: If you wish to separate data from presentation, use
    >> strict, otherwise use transitional.

    > Perhaps the other way round: if you really don't want to / can't separate
    > data and style, use transitional. If you want them separated, both
    > transitional and strict will do, though. It's just that strict more or
    > less of forces you to do it.
    >
    >> Q1: The way I understand it, to separate data from presentation, I would
    >> have to use XSLT, wouldn't I?

    > XSLT is a generic style markup language, used for generic XML. You use
    > XHTML, which is a subset, so css is fine and preferred. (Hm... preffered?
    > I'm not exactly at home with XML, but I think XSLT isn't even a proper
    > substitute for CSS. What you can do with XSLT, AFAIK, is transform it into
    > a (possibly CSS-enhanced) XHTML file).
    >
    >> Q2: Since it is a multilanguage app, I have all the docs UTF-8 encoded.
    >> UTF-8 kinda requires 3 lead bytes to tell the reader how the file is
    >> encoded, but validator says (error in document) that I should avoid
    >> those 3 bytes. I can of course do that, but then I would break UTF-8
    >> rules!?!

    > Nope, the leading bytes (called byte order mark) are optional for UTF-8:
    > http://www.unicode.org/faq/utf_bom.html#22
    >
    >> Q3: Additionally, I have a problem with tables: I made myself a
    >> JavaScript table object which allows me to interactively show SQL
    >> queries in HTML
    >> tables (through some XML / PHP / SOAP). Anyway, for this object to work
    >> correctly, I have to tell it each field's unique value, which I do
    >> through a <TR> attribute "uniqueid". (<tr
    >> uniqueid="xxx"><td........</tr>) Of course, the validator is not
    >> particulary happy about this attribute since it is
    >> unknown. Is there any other way to have this information in the table in
    >> a valid form?

    > Two ways: you can (a) write your own DTD which allows the uniqueid
    > attribute or, much better, you can (b) use the standard id attribute, as
    > in <tr id="foo">.
    >
    > HTH,
    > Mitja
    Jure Erznoznik, Apr 19, 2005
    #4
  5. Jure Erznoznik

    Mitja Guest

    Top posting is frowned upon in this NG. Rather than typing Q1, Q2 etc.,
    quote the appropriate parts, like so:

    >>> Q3: Additionally, I have a problem with tables: I made myself a
    >>> JavaScript table object which allows me to interactively show SQL
    >>> queries in HTML
    >>> tables (through some XML / PHP / SOAP). Anyway, for this object to work
    >>> correctly, I have to tell it each field's unique value, which I do
    >>> through a <TR> attribute "uniqueid". (<tr
    >>> uniqueid="xxx"><td........</tr>) Of course, the validator is not
    >>> particulary happy about this attribute since it is
    >>> unknown. Is there any other way to have this information in the table
    >>> in a valid form?

    >> Two ways: you can (a) write your own DTD which allows the uniqueid
    >> attribute or, much better, you can (b) use the standard id attribute, as
    >> in <tr id="foo">.

    > Q3: Maybe id attribute will really be fine. I was afraid to use it since
    > it means quite a lot in the standard itself. I don't think writing my
    > own DTD would be sane.

    Yeah, a custom DTD is a geeky option at best...

    > But that raises another question of what to do when I need
    > multiple such attributes...

    Then HTML is not suited for it. Let us know more about the background,
    about what you want to achieve and how you currently implement it. The
    answer will most probably be a slightly different and more elegant
    approach avoiding your current problems.
    Mitja, Apr 19, 2005
    #5
    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. Peter L.
    Replies:
    0
    Views:
    322
    Peter L.
    Oct 20, 2003
  2. Rob Roberts
    Replies:
    5
    Views:
    2,804
    Rob Roberts
    Jan 20, 2006
  3. Christopher R

    xhtml strict is being very stict why?

    Christopher R, Oct 1, 2003, in forum: HTML
    Replies:
    13
    Views:
    798
  4. Brendan

    Need help with strict XHTML

    Brendan, Nov 3, 2003, in forum: HTML
    Replies:
    4
    Views:
    396
    Brendan
    Nov 3, 2003
  5. Tom

    XHTML Strict and Script

    Tom, Nov 15, 2003, in forum: HTML
    Replies:
    6
    Views:
    665
    Woolly Mittens
    Nov 15, 2003
Loading...

Share This Page