DTDs, www & validation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael Rozdoba

    DTDs, www & validation

    I've been wandering around the results of numerous googles for several
    hours without reaching a conclusive solution, so I'm dipping a tentative
    toe back in ciwah...

    I've been persuaded here in the past that serving xhtml is a bad thing (tm).

    I want the extra constraints xhtml imposes.

    It has been suggested before to create a DTD which requires these &
    includes all the requirements of HTML 4.01 & validate against that.

    I've downloaded such a document from
    http://www.spartanicus.utvinternet.i...1-stricter.dtd which I'm
    sure looks familiar to all the regulars here.

    My questions are pretty simple to state:

    How do I make use of this to achieve the above?

    I know I can declare <!DOCTYPE HTML SYSTEM
    "http://www.spartanicus .utvinternet.ie/html401-stricter.dtd">
    (though I'd first either enquire as to whether I should use this url or
    duplicate the file on my own server).

    However I'm concerned as to whether some browsers will do something
    undesirable in their interpretation of my pages when they see this,
    rather than a standard public declaration.

    Also, http://www.spartanicus.utvinternet.ie/no-xhtml.htm which links to
    the above DTD, declares itself as HTML 4.01.

    This leads me to wonder, am I supposed to use the !DOCTYPE HTML SYSTEM
    form only for development validation & then replace this with a !DOCTYPE
    HTML PUBLIC referring to HTML 4.01 prior to the site going live?

    However, if that is what one should do, why not just declare an XHTML
    1.0 doctype while developing & then replace this with the html 4.01 type
    prior to going live to achieve an equivalent effect?

    Is there an ideal solution?

    Along the way, which resources do the readers here use for validation?
    Software installed locally & if so, what, or the online services of w3c
    or wdg?

    Lastly, for a current project I'm forced to use DreamweaverMX20 04; can
    it be persuaded to validate against a custom dtd?

    Perhaps there's a different & better solution to this whole problem.

    --
    Michael
    m r o z a t u k g a t e w a y d o t n e t
  • Darin McGrew

    #2
    Re: DTDs, www &amp; validation

    Michael Rozdoba <mroz@nowhere.i nvalid> wrote:[color=blue]
    > I've downloaded such a document from
    > http://www.spartanicus.utvinternet.i...1-stricter.dtd which I'm
    > sure looks familiar to all the regulars here.
    >
    > My questions are pretty simple to state:
    >
    > How do I make use of this to achieve the above?[/color]

    I merely configured my local validator to use my custom DTD rather than the
    W3C's DTD when it sees the W3C's standard DOCTYPE declaration. My custom
    DTD is more restrictive than the W3C's DTD, so if a document validates
    against my DTD, then it will validate against the W3C's DTD as advertised.

    Technically, if your custom DTD allows markup that the W3C's DTD doesn't
    allow (e.g., http://www.cs.tut.fi/~jkorpela/html/strict.dtd), then you're
    guilty of false advertizing if you use one of the W3C's standard DOCTYPE
    declarations. But I think that's the lesser evil in these days of browsers
    with DOCTYPE sniffing.

    FWIW, I don't bother using the DTD to enforce XML-like requirements that
    all attributes be quoted, that optional closing tags be used, etc. For
    that, I use a tool that adds quotes, closing tags, etc.:

    [color=blue]
    > Along the way, which resources do the readers here use for validation?[/color]

    I've got a copy of nsgmls installed locally:


    I use makefiles to run an HTML preprocessor and other programs to
    automatically generate and validate HTML documents from preprocessor
    source, data files, etc.
    --
    Darin McGrew, mcgrew@stanford alumni.org, http://www.rahul.net/mcgrew/
    Web Design Group, darin@htmlhelp. com, http://www.HTMLHelp.com/

    "Cheaters never win; they just finish first." - Johhny Hart

    Comment

    • Eric B. Bednarz

      #3
      Re: DTDs, www &amp; validation

      Michael Rozdoba <mroz@nowhere.i nvalid> writes:
      [color=blue]
      > I want the extra constraints xhtml imposes.[/color]

      Uh, all of them?

      <http://groups-beta.google.com/group/alt.html/msg/bab970becd5a41d 3>

      might answer some of your questions, also some you forgot (groups-beta
      is bloody annoying, BTW).
      [color=blue]
      > This leads me to wonder, am I supposed to use the !DOCTYPE HTML SYSTEM
      > form only for development validation & then replace this with a
      > !DOCTYPE HTML PUBLIC referring to HTML 4.01 prior to the site going
      > live?[/color]

      No; you can just use the public identifier for HTML 4.01, and override
      that locally. If you haven't, you should look into (X)Emacs which
      allows for using your private DTD for the editing part, not just after
      the fact control.
      [color=blue]
      > Lastly, for a current project I'm forced to use DreamweaverMX20 04; can
      > it be persuaded to validate against a custom dtd?[/color]

      Since when does Dreamweaver ship with a validating system?


      --
      | ) Più Cabernet,
      -( meno Internet.
      | ) http://bednarz.nl/

      Comment

      • Michael Rozdoba

        #4
        Re: DTDs, www &amp; validation

        Darin McGrew wrote:
        [color=blue]
        > I merely configured my local validator to use my custom DTD rather
        > than the W3C's DTD when it sees the W3C's standard DOCTYPE
        > declaration.[/color]

        That was why I asked a later question about where posters validate -
        local looks like a better solution as one has more control. This seems
        much more practical.
        [color=blue]
        > My custom DTD is more restrictive than the W3C's DTD, so if a
        > document validates against my DTD, then it will validate against the
        > W3C's DTD as advertised.[/color]

        Indeed.
        [color=blue]
        > Technically, if your custom DTD allows markup that the W3C's DTD
        > doesn't allow (e.g., http://www.cs.tut.fi/~jkorpela/html/strict.dtd),
        > then you're guilty of false advertizing if you use one of the W3C's
        > standard DOCTYPE declarations.[/color]

        Quite - not something I'd do intentionally; anyhow, I'm sure I'm
        incompetent enough to make up for that with other errors.
        [color=blue]
        > But I think that's the lesser evil in these days of browsers with
        > DOCTYPE sniffing.
        >
        > FWIW, I don't bother using the DTD to enforce XML-like requirements
        > that all attributes be quoted, that optional closing tags be used,
        > etc. For that, I use a tool that adds quotes, closing tags, etc.:
        > http://www.jclark.com/sp/spam.htm[/color]

        Interesting. Thanks, I'll look into that, though I think I'd rather be
        in the habit of writing them myself. As long as I am writing code by
        hand I'd rather write it the way I mean it to end up, iyswim.
        [color=blue][color=green]
        >> Along the way, which resources do the readers here use for
        >> validation?[/color]
        >
        >
        > I've got a copy of nsgmls installed locally:
        > http://www.jclark.com/sp/nsgmls.htm[/color]

        That I definitely will pay a visit to shortly.
        [color=blue]
        > I use makefiles to run an HTML preprocessor and other programs to
        > automatically generate and validate HTML documents from preprocessor
        > source, data files, etc.[/color]

        Sounds like fun. I think I'll not get into that for the time being - got
        enough on my plate atm. Cheers.

        --
        Michael
        m r o z a t u k g a t e w a y d o t n e t

        Comment

        • Michael Rozdoba

          #5
          Re: DTDs, www &amp; validation

          Eric B. Bednarz wrote:[color=blue]
          > Michael Rozdoba <mroz@nowhere.i nvalid> writes:
          >
          >[color=green]
          >>I want the extra constraints xhtml imposes.[/color]
          >
          >
          > Uh, all of them?[/color]

          Erm, probably not - bad choice of wording. The only ones I had in mind
          were closing of elements & quoting of attributes. Though I have no
          immediate objections to any constraints which force greater separation
          of content & presentation. Does xhtml impose additional constraints
          outside of those?[color=blue]
          >
          > <http://groups-beta.google.com/group/alt.html/msg/bab970becd5a41d 3>
          >
          > might answer some of your questions, also some you forgot[/color]

          Thanks :)
          [color=blue]
          > (groups-beta
          > is bloody annoying, BTW).[/color]

          I've not made my mind up - without getting too OT, what's annoying you
          the most?
          [color=blue][color=green]
          >>This leads me to wonder, am I supposed to use the !DOCTYPE HTML SYSTEM
          >>form only for development validation & then replace this with a
          >>!DOCTYPE HTML PUBLIC referring to HTML 4.01 prior to the site going
          >>live?[/color]
          >
          >
          > No; you can just use the public identifier for HTML 4.01, and override
          > that locally.[/color]

          Which again implies local validation. I'll try to sort that out now.
          [color=blue]
          > If you haven't, you should look into (X)Emacs which
          > allows for using your private DTD for the editing part, not just after
          > the fact control.[/color]

          I wonder if I can do that with vim? I'm using vim not as I know it yet
          but because I like it & am trying to force myself to learn to use it ;)
          I needed a good editor which doesn't require a gui; forget why I plumped
          for vi et al rather than emacs.

          That all said, I'm required to use DW & also need to use it in order to
          learn how to use it - as part of a course module - for my current
          project, so the more closely I can integrate a validation solution with
          DW the better.

          I've already had to edit a couple of its config files manually to get it
          to stop choosing transitional dtds which afaic is wasting my time - not
          as friendly as I was told it is. That said, the code it produces doesn't
          look too bad & it seems to let me stay in control most of the time.
          [color=blue][color=green]
          >>Lastly, for a current project I'm forced to use DreamweaverMX20 04; can
          >>it be persuaded to validate against a custom dtd?[/color]
          >
          >
          > Since when does Dreamweaver ship with a validating system?[/color]

          I can't claim for certain it does, however it does allow one to validate
          documents one way or another. Also, I've read some third party
          documentation which implies it has it's own validation code.

          If I wasn't in the middle of several downloads I'd kill my net
          connection & try validating a few files. Will do that later.

          This is in respect of DW MX2004 v7.0 btw.

          --
          Michael
          m r o z a t u k g a t e w a y d o t n e t

          Comment

          • Nick Kew

            #6
            Re: DTDs, www &amp; validation

            In article <41ba13d8$0$107 0$db0fefd9@news .zen.co.uk>,
            Michael Rozdoba <mroz@nowhere.i nvalid> writes:
            [color=blue]
            > I've been persuaded here in the past that serving xhtml is a bad thing (tm).[/color]

            I'd be inclined to call it neutral in the real world. Neither good nor
            bad (unless you get carried away).
            [color=blue]
            > I want the extra constraints xhtml imposes.[/color]

            You can get that very easily.
            See http://valet.webthing.com/page/parsemode.html
            [color=blue]
            > It has been suggested before to create a DTD which requires these &
            > includes all the requirements of HTML 4.01 & validate against that.[/color]

            That's the hard way, and leaves you at the mercy of browser quirks.

            --
            Nick Kew

            Nick's manifesto: http://www.htmlhelp.com/~nick/

            Comment

            • Spartanicus

              #7
              Re: DTDs, www &amp; validation

              Michael Rozdoba <mroz@nowhere.i nvalid> wrote:
              [color=blue]
              >I know I can declare <!DOCTYPE HTML SYSTEM
              >"http://www.spartanicus .utvinternet.ie/html401-stricter.dtd">
              >(though I'd first either enquire as to whether I should use this url or
              >duplicate the file on my own server).
              >
              >However I'm concerned as to whether some browsers will do something
              >undesirable in their interpretation of my pages when they see this,
              >rather than a standard public declaration.[/color]

              Unlikely (I'm not aware of any that do), but it's possible.
              [color=blue]
              >Also, http://www.spartanicus.utvinternet.ie/no-xhtml.htm which links to
              >the above DTD, declares itself as HTML 4.01.
              >
              >This leads me to wonder, am I supposed to use the !DOCTYPE HTML SYSTEM
              >form only for development validation & then replace this with a !DOCTYPE
              >HTML PUBLIC referring to HTML 4.01 prior to the site going live?[/color]

              As you've realised it revolves around how you validate, if you want to
              use one of the online validators then you'd have to use a custom system
              doctype and upload the DTD to your server. (linking to a DTD on someone
              else's server is not nice and it makes you dependant on that server)

              If you use a local validator then for DTDs that use a subset of the
              public DTD, (no new elements), you can use the public doctype and
              override the location of the DTD locally to a local DTD. (I've elected
              to omit the uri from the doctype declaration but this isn't the best
              way).

              Personally I use ARV as a local Windows validator (
              http://www.arealvalidator.com ) Note that it has a limitation: it can
              only validate files on the local file system, not on a server.

              From the link Eric provided you will have understood that certain
              differences between XHTML and HTML like mandatory attribute quoting and
              element case sensitivity are not governed by the DTD but by the SGML
              stuff that goes with it.

              I'll expand the bit on validating against a custom DTD on the no-xhtml
              document later.

              --
              Spartanicus

              Comment

              • Michael Rozdoba

                #8
                Re: DTDs, www &amp; validation

                Nick Kew wrote:[color=blue]
                > In article <41ba13d8$0$107 0$db0fefd9@news .zen.co.uk>,
                > Michael Rozdoba <mroz@nowhere.i nvalid> writes:
                >
                >[color=green]
                >>I've been persuaded here in the past that serving xhtml is a bad thing (tm).[/color]
                >
                >
                > I'd be inclined to call it neutral in the real world. Neither good nor
                > bad (unless you get carried away).[/color]

                Last time I innocently tried that around here I got an intellectual
                kneecapping :) - you wouldn't be suggesting this isn't the real world
                would you? ;)
                [color=blue][color=green]
                >>I want the extra constraints xhtml imposes.[/color]
                >
                > You can get that very easily.
                > See http://valet.webthing.com/page/parsemode.html[/color]

                Yes, that popped up recently. Another handy check.[color=blue]
                >
                >[color=green]
                >>It has been suggested before to create a DTD which requires these &
                >>includes all the requirements of HTML 4.01 & validate against that.[/color]
                >
                > That's the hard way, and leaves you at the mercy of browser quirks.[/color]

                You mean if a document is made public with such a DTD still in place?
                That was what I feared :/

                Ah well, no harm. I've gone down the suggested route of installing local
                validation via "A Real Validator 1.11" & used it to override the HTML
                4.01 DTD with http://www.spartanicus.utvinternet.i...1-stricter.dtd

                I think this gives me most of what I want. Though atm I see it won't let
                me close empty tags. Is that a bad thing to want to do with something
                claiming to be HTML 4.01? I'd rather have my docs in a format as close
                to XML as possible, whilst still being valid HTML 4.01.

                If it can be done, any pointers to altering the DTD appropriately? If
                it's a case of RTFM, an ptrs to that? Cheers.

                --
                Michael
                m r o z a t u k g a t e w a y d o t n e t

                Comment

                • Darin McGrew

                  #9
                  Re: DTDs, www &amp; validation

                  Michael Rozdoba <mroz@nowhere.i nvalid> wrote:[color=blue]
                  > I think this gives me most of what I want. Though atm I see it won't let
                  > me close empty tags. Is that a bad thing to want to do with something
                  > claiming to be HTML 4.01? I'd rather have my docs in a format as close
                  > to XML as possible, whilst still being valid HTML 4.01.[/color]

                  Closing empty tags makes it invalid HTML. Well, sorta, depending on the
                  empty tag. But if it *is* valid HTML, then it isn't what you wanted. For
                  example, in HTML,

                  <img src=... alt=... />

                  is technically equivalent to

                  <img src=... alt=...>>

                  or

                  <img src=... alt=...>&gt;

                  It doesn't matter that much for tags like <img> or <br> that appear in the
                  BODY: You just get a few '>' characters scattered here and there. But for
                  tags like <link> that appear in the HEAD, it causes problems, because the
                  text content (the extra '>' characters) closes the HEAD.

                  Appendix C compatability relies on browsers ignoring this bit of SGML-based
                  trivia. Most do, but not all.
                  --
                  Darin McGrew, mcgrew@stanford alumni.org, http://www.rahul.net/mcgrew/
                  Web Design Group, darin@htmlhelp. com, http://www.HTMLHelp.com/

                  "You can't strengthen the weak by weakening the strong."

                  Comment

                  • Spartanicus

                    #10
                    Re: DTDs, www &amp; validation

                    Michael Rozdoba <mroz@nowhere.i nvalid> wrote:
                    [color=blue]
                    >Though atm I see it won't let
                    >me close empty tags. Is that a bad thing to want to do with something
                    >claiming to be HTML 4.01?[/color]

                    Of course it is, it's not allowed under HTML.
                    [color=blue]
                    >I'd rather have my docs in a format as close
                    >to XML as possible, whilst still being valid HTML 4.01.[/color]

                    Feel free to author in X(HT)ML if it has a real benefit to you (the
                    ability to use XML tools on the data for example), you should then use
                    those XML tools to generate HTML from the X(HT)ML and serve that to
                    clients.

                    --
                    Spartanicus

                    Comment

                    • Andy Dingley

                      #11
                      Re: DTDs, www &amp; validation

                      On Fri, 10 Dec 2004 21:27:33 +0000, Michael Rozdoba
                      <mroz@nowhere.i nvalid> wrote:
                      [color=blue]
                      >I want the extra constraints xhtml imposes.[/color]

                      It doesn't. XHTML is (by design) a literal transcoding of HTML 4.01
                      (both Strict and Transitional) from HTML's almost-SGML into XML.
                      There are _no_ extra constraints imposed by XHTML.

                      Now if you want to do this (there are negligible good reasons to do
                      so), then just use XHTML. Or you could invent your own XML-flavour of
                      HTML 4.01 and use that with its own DTD, but this would have to be
                      equivalent to XHTML anyway.

                      XHTML causes problems for serving to browsers (allegedly) because of
                      its XML nature, not because of its DTD. Any "constraint " you might
                      wish to gain can only be this same added XML nature, and so you might
                      as well switch wholesale to XHTML.

                      XHTML does not modify the HTML 4.01 DTD. If you wanted to do this
                      (maybe add the <blink> element), then you could certainly do so, but
                      you'd do that by a custom DTD and could stay within the bounds of
                      SGML-style HTML

                      --
                      Smert' spamionam

                      Comment

                      • Eric B. Bednarz

                        #12
                        Re: DTDs, www &amp; validation

                        Michael Rozdoba <mroz@nowhere.i nvalid> writes:
                        [color=blue]
                        > Eric B. Bednarz wrote:[/color]
                        [color=blue][color=green]
                        >> (groups-beta is bloody annoying, BTW).[/color]
                        >
                        > I've not made my mind up - without getting too OT, what's annoying you
                        > the most?[/color]

                        Legacy URI references to articles are redirected to threads (WTF is
                        that? It even seems like more work).

                        To view a single message I have to choose options, and then individual
                        message (one action for the price of two, how cool); once I'm there, to
                        go to the thread I have to choose options and, erm, get a link to the
                        message that I'm currently viewing. If I didn't come from the thread,
                        dead end.

                        What's the point of killing the framed tree view when I get a pointless
                        sidebar instead of some screen estate?

                        How much webdesigners does it take to install a light bulb, or combine
                        impenetrable table-salad with all the disadvantages of CSS layout?

                        <http://sandbox.bednarz .nl/.swap/beta.png> (20.5KiB)
                        [color=blue]
                        > I wonder if I can do that with vim?[/color]

                        Not that I know of.
                        [color=blue]
                        > I'm using vim not as I know it yet
                        > but because I like it[/color]

                        Oh, but Vim *is* a much better text-editor than Emacs. To write HTML
                        from scratch, I'd almost always use Vim; but to edit Document Types I'm
                        not familiar with I'd almost always use Emacs. The same goes for minor
                        changes, because I'm usually in it anyway because I use it as (local and
                        remote) file manager, email and news client and to have my cup of tea.
                        [color=blue]
                        > forget why I plumped for vi et al rather than emacs.[/color]

                        Maybe your hands aren't big enough to perform most of the required
                        keyboard longcuts. :)


                        --
                        | ) Più Cabernet,
                        -( meno Internet.
                        | ) http://bednarz.nl/

                        Comment

                        • C A Upsdell

                          #13
                          Re: DTDs, www &amp; validation

                          "Andy Dingley" <dingbat@codesm iths.com> wrote in message
                          news:6f1mr09hgr 40qmpdd0df2pqor 3pj8hqt7t@4ax.c om...[color=blue]
                          > On Fri, 10 Dec 2004 21:27:33 +0000, Michael Rozdoba
                          > <mroz@nowhere.i nvalid> wrote:
                          >[color=green]
                          >>I want the extra constraints xhtml imposes.[/color]
                          >[color=green]
                          > > There are _no_ extra constraints imposed by XHTML.[/color][/color]

                          Not correct. E.g., xHTML requires end tags where in HTML they are optional.



                          Comment

                          • Michael Rozdoba

                            #14
                            Re: DTDs, www &amp; validation

                            Eric B. Bednarz wrote:[color=blue]
                            > Michael Rozdoba <mroz@nowhere.i nvalid> writes:[/color]

                            [annoying google groups beta]
                            [color=blue]
                            > Legacy URI references to articles are redirected to threads (WTF is
                            > that? It even seems like more work).[/color]

                            Ah yes, I did notice that. Thankfully I usually want thread views, but
                            now I see what you mean.

                            [snip critique]

                            Um, it is beta ;)

                            I hope they're getting informative feedback.
                            [color=blue]
                            > How much webdesigners does it take to install a light bulb, or combine
                            > impenetrable table-salad with all the disadvantages of CSS layout?
                            >
                            > <http://sandbox.bednarz .nl/.swap/beta.png> (20.5KiB)[/color]

                            Ouch :/

                            [vim/emacs]
                            [color=blue]
                            > Oh, but Vim *is* a much better text-editor than Emacs. To write HTML
                            > from scratch, I'd almost always use Vim; but to edit Document Types I'm
                            > not familiar with I'd almost always use Emacs. The same goes for minor
                            > changes, because I'm usually in it anyway because I use it as (local and
                            > remote) file manager, email and news client and to have my cup of tea.[/color]

                            LOL. I guess if I'm doing this enough I'll eventually learn which tool
                            does the best job for each task.

                            --
                            Michael
                            m r o z a t u k g a t e w a y d o t n e t

                            Comment

                            • Michael Rozdoba

                              #15
                              Re: DTDs, www &amp; validation

                              Darin McGrew wrote:
                              [color=blue]
                              > Closing empty tags makes it invalid HTML. Well, sorta, depending on the
                              > empty tag.[/color]

                              [snip]
                              [color=blue]
                              > Appendix C compatability relies on browsers ignoring this bit of SGML-based
                              > trivia. Most do, but not all.[/color]

                              I was aware that it usually works but not that this is as a result of
                              what looks like a fluke. I don't mind bending rules to get meet my
                              desires but I'm not keen on breaking them without very good reason. Thanks.

                              --
                              Michael
                              m r o z a t u k g a t e w a y d o t n e t

                              Comment

                              Working...