Can I make up my own DTD?

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

    Can I make up my own DTD?

    I've arrived at a compromise whereby I use valid HTML 4.01, *except*
    that I want to use the nonstandard "bordercolo r" attribute for tables.

    My code validates just fine except for this hack/workaround.

    So here's my question -- can I make up my own DTD?

    Grab http://www.w3.org/TR/1999/REC-html40...1224/loose.dtd, add one
    attribute to the table spec, save it as
    http://www.mysite.com/DTD/even-looser.dtd and put that in my own
    custom DOCTYPE?

    I realise this is a somewhat meaningless exercise, and purely an
    academic question, but what would a parser or syntax checker do? I'd
    be interested in your thoughts.

    TIA
  • Eric Bohlman

    #2
    Re: Can I make up my own DTD?

    hostile17@bigfo ot.com (Hostile17) wrote in
    news:c610561.03 09171657.421301 25@posting.goog le.com:
    [color=blue]
    > I've arrived at a compromise whereby I use valid HTML 4.01, *except*
    > that I want to use the nonstandard "bordercolo r" attribute for tables.
    >
    > My code validates just fine except for this hack/workaround.
    >
    > So here's my question -- can I make up my own DTD?
    >
    > Grab http://www.w3.org/TR/1999/REC-html40...1224/loose.dtd, add one
    > attribute to the table spec, save it as
    > http://www.mysite.com/DTD/even-looser.dtd and put that in my own
    > custom DOCTYPE?
    >
    > I realise this is a somewhat meaningless exercise, and purely an
    > academic question, but what would a parser or syntax checker do? I'd
    > be interested in your thoughts.[/color]

    It would work just fine; just be honest and don't claim that your HTML is
    validated against one of the official versions.

    Comment

    • David Dorward

      #3
      Re: Can I make up my own DTD?

      Hostile17 wrote:
      [color=blue]
      > I've arrived at a compromise whereby I use valid HTML 4.01, *except*
      > that I want to use the nonstandard "bordercolo r" attribute for tables.[/color]

      Why? What's wrong with the border-color property of CSS?
      [color=blue]
      > So here's my question -- can I make up my own DTD?[/color]

      Yes
      [color=blue]
      > Grab http://www.w3.org/TR/1999/REC-html40...1224/loose.dtd, add one
      > attribute to the table spec, save it as
      > http://www.mysite.com/DTD/even-looser.dtd and put that in my own
      > custom DOCTYPE?[/color]

      Yes
      [color=blue]
      > I realise this is a somewhat meaningless exercise, and purely an
      > academic question, but what would a parser or syntax checker do?[/color]

      It will tell you the document is valid. The document won't be HTML, and
      browsers will probably switch to buggy backwards mode (AKA Quirks mode),
      but it will be a valid SGML document.

      --
      David Dorward http://dorward.me.uk/

      Comment

      • Hostile17

        #4
        Re: Can I make up my own DTD?

        David Dorward <dorward@yahoo. com> wrote in message news:<bkbisq$p7 m$3$8300dec7@ne ws.demon.co.uk> ...[color=blue]
        > Hostile17 wrote:
        >[color=green]
        > > I've arrived at a compromise whereby I use valid HTML 4.01, *except*
        > > that I want to use the nonstandard "bordercolo r" attribute for tables.[/color]
        >
        > Why? What's wrong with the border-color property of CSS?[/color]

        Well it's a hack, as I said, but here's the thing.

        IE's bordercolor puts the same width border around everything. The
        table itself and every table cell.

        By "the same width" I mean that if I have a border around the table,
        that's 1px border around the outside; the rectangle that defines the
        outsides of the table. Then if I want borders around the table cells I
        can do that with CSS too but now I've got two pixels, haven't I? The
        border around the table and the border around the cell. And there are
        two pixels where the border of one cell meets the border of another.
        Bordercolor does that so well.

        Maybe I'm confused and I'm missing something about CSS?

        The only way I know to do this in CSS is have a mess of complex border
        specs so that the leftmost cell has a left border, the rightmost cell
        has a right border but the ones in the middle have both and so on.

        The other way is to have a background colour for the whole table, set
        cellspacing to 1 and set a foreground colour to each TD. This doesn't
        produce any effect in older Netscapes -- and is cellspacing valid
        anyway? It's not a property in CSS, only in HTML, in the TABLE tag.

        I have got SO off-topic.

        Thanks for your help everyone.

        Comment

        • Jukka K. Korpela

          #5
          Re: Can I make up my own DTD?

          hostile17@bigfo ot.com (Hostile17) wrote:
          [color=blue]
          > IE's bordercolor puts the same width border around everything. The
          > table itself and every table cell.[/color]

          It depends on your purposes whether this is a benefit or a problem. But it
          can be achieved in CSS, too. Usual caveats apply.
          [color=blue]
          > Then if I want borders around the table cells I
          > can do that with CSS too but now I've got two pixels, haven't I?[/color]

          This depends on the value of the border-collapse property.
          [color=blue]
          > Maybe I'm confused and I'm missing something about CSS?[/color]

          border-collapse: collapse
          [color=blue]
          > I have got SO off-topic.[/color]

          The details of styling surely belong to c.i.w.a.stylesh eets, but it's
          probably on-topic here to point out that there _are_ alternatives to the
          proprietary bordercolor attribute.

          --
          Yucca, http://www.cs.tut.fi/~jkorpela/
          Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

          Comment

          • Brian

            #6
            Re: Can I make up my own DTD?

            Hostile17 wrote:[color=blue]
            >
            > Maybe I'm confused and I'm missing something about CSS?
            >
            > The only way I know to do this in CSS is have a mess of complex border
            > specs[/color]

            Set up columns in html, assign classes. Then apply borders based on
            that class, or to the table. That simplifies things a great deal.

            table {
            border-top: 1px solid green;
            border-left: 1px solid green;
            }

            td {
            border-bottom: 1px solid green;
            border-right: 1px solid green;
            }

            For an example, see
            < http://www.julietremblay.com/portfolio/catalogue.html >

            True, there are no borders in the middle, but it should still give you
            some ideas. I used border-collapse: collapse ; in css. MSIE/Mac does
            not support the css border-collapse property, so I added
            cellspacing="0" to the table element in the html.
            [color=blue]
            > The other way is to have a background colour for the whole table, set
            > cellspacing to 1 and set a foreground colour to each TD.[/color]

            That's a hack!
            [color=blue]
            > is cellspacing valid anyway?[/color]

            Yes, even in html 4.01/strict.

            --
            Brian
            follow the directions in my address to email me

            Comment

            • Henri Sivonen

              #7
              Re: Can I make up my own DTD?

              In article <bkbisq$p7m$3$8 300dec7@news.de mon.co.uk>,
              David Dorward <dorward@yahoo. com> wrote:
              [color=blue]
              > The document won't be HTML,[/color]

              Would it be appropriate to serve it as text/html then?
              [color=blue]
              > and
              > browsers will probably switch to buggy backwards mode (AKA Quirks mode),
              > but it will be a valid SGML document.[/color]

              Contemporary Mozilla and Safari (at least) would choose the standards
              mode. (But I don't recommend relying on that.)

              --
              Henri Sivonen
              hsivonen@iki.fi

              Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html

              Comment

              • Jukka K. Korpela

                #8
                Re: Can I make up my own DTD?

                Henri Sivonen <hsivonen@iki.f i> wrote:
                [color=blue][color=green]
                >> The document won't be HTML,[/color]
                >
                > Would it be appropriate to serve it as text/html then?[/color]

                If the use of a browser-specific attribute makes a document "not HTML",
                and even one that should not be served as text/html, we might raise an
                analogous question: If your document in English contains a single spelling
                error, turning an English word to something that does not exist in English
                dictionaries, does the document turn into non-English, and would it be
                appropriate to serve it with Content-Language: en or use <html lang="en">
                in it?

                According to the IANA registry, the media type text/html is defined by
                RFC 2854, which is very vague for an RFC. It says, in the part that looks
                authoritative:

                Published specification:
                The text/html media type is now defined by W3C Recommendations ;
                the latest published version is [HTML401]. In addition, [XHTML1]
                defines a profile of use of XHTML which is compatible with HTML
                4.01 and which may also be labeled as text/html.

                This seems to say that currently only HTML 4.01 and XHTML 1.0 and
                XHTML 1.1 documents are text/html. The W3C says that HTML 3.2 has been
                superseded, and it is probably fair to interpret the phrase
                "W3C Recommendations " as referring to recommendations "in force" only.
                In any case, the definition seems to exclude HTML 2.0 conformant documents
                (at least due to DOCTYPE declaration difference).

                But RFC 2854 makes several references to HTML 2.0, HTML 3.2, and HTML 4.0
                in a manner that strongly suggests that text/html is to be understood in a
                fairly generic meaning, as HTML in a broad sense. It even mentions them as
                "dialects".

                --
                Yucca, http://www.cs.tut.fi/~jkorpela/
                Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

                Comment

                • Brian

                  #9
                  Re: Can I make up my own DTD?

                  Jukka K. Korpela wrote:[color=blue]
                  >
                  > If the use of a browser-specific attribute makes a document "not
                  > HTML", and even one that should not be served as text/html, we
                  > might raise an analogous question: If your document in English
                  > contains a single spelling error, turning an English word to
                  > something that does not exist in English dictionaries, does the
                  > document turn into non-English, and would it be appropriate to
                  > serve it with Content-Language: en or use <html lang="en"> in it?[/color]

                  I don't think the analogy is correct. A document with a spelling
                  mistake is analogous to an html document with a syntax error. I
                  suppose there is not much real difference, it's a matter of intention,
                  where an error should be fixed. If one declares his or her own dtd,
                  there is no error to be fixed. A closer analogy: someone writes a
                  document in English, with lang="en", but intentionally includes
                  invented words.

                  <p>I took my spseeyeerzat out for a walk.</p>

                  Declaring that as en is dubious practise, since no English speaker
                  knows what a spseeyeerzat is.
                  [color=blue]
                  > But RFC 2854 makes several references to HTML 2.0, HTML 3.2, and
                  > HTML 4.0 in a manner that strongly suggests that text/html is to be
                  > understood in a fairly generic meaning, as HTML in a broad sense.
                  > It even mentions them as "dialects".[/color]

                  I defer on real-world issues and rfc documents.


                  --
                  Brian
                  follow the directions in my address to email me

                  Comment

                  • Jukka K. Korpela

                    #10
                    Re: Can I make up my own DTD?

                    Brian <usenet1@mangym utt.com.invalid-remove-this-part> wrote:
                    [color=blue]
                    > I don't think the analogy is correct. A document with a spelling
                    > mistake is analogous to an html document with a syntax error.[/color]

                    Yes, it could be put that way. So if you take an HTML document and modify
                    it so that there is a small syntax error, say <table cellpading="1"> , does
                    it stop being text/html? If text/html is defined by (newest) W3C
                    specifications, it is not - it does not comply with any specification.
                    [color=blue]
                    > I suppose there is not much real difference, it's a matter of intention,
                    > where an error should be fixed. If one declares his or her own dtd,
                    > there is no error to be fixed.[/color]

                    The observation is correct and relevant, but does this mean that a
                    document that uses a bordercolor attribute is an HTML document if the user
                    wrote it by mistake? (Maybe the user did not know what attributes are
                    "standard". ) Or if the user intentionally used a nonstandard attribute, is
                    the document text/html if there is no customized DTD?
                    [color=blue]
                    > A closer analogy: someone writes a
                    > document in English, with lang="en", but intentionally includes
                    > invented words.
                    >
                    > <p>I took my spseeyeerzat out for a walk.</p>
                    >
                    > Declaring that as en is dubious practise, since no English speaker
                    > knows what a spseeyeerzat is.[/color]

                    Is it? Fantasy and sci-fi novels often contain such texts. If they are not
                    English, what are they? Surely the text is English, it just contains a
                    foreign or invented word - and you could use <span lang="und">
                    spseeyeerzat</span> to indicate this, but if the intent was to introduce a
                    word into English, at least into some very specific ideolect, then it
                    should be declared simply as English. Languages (that is, human languages)
                    are changing and open systems by essence.

                    --
                    Yucca, http://www.cs.tut.fi/~jkorpela/
                    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

                    Comment

                    • David Dorward

                      #11
                      Re: Can I make up my own DTD?

                      Hostile17 wrote:
                      [color=blue][color=green]
                      >> Why? What's wrong with the border-color property of CSS?[/color][/color]
                      [color=blue]
                      > IE's bordercolor puts the same width border around everything. The
                      > table itself and every table cell.
                      >
                      > By "the same width" I mean that if I have a border around the table,
                      > that's 1px border around the outside; the rectangle that defines the
                      > outsides of the table. Then if I want borders around the table cells I
                      > can do that with CSS too but now I've got two pixels, haven't I?[/color]

                      You have a 1px border around each cell, and where you have two borders
                      touching you have 2px.

                      Collapse them in to one with the border-collapse property.

                      --
                      David Dorward http://dorward.me.uk/

                      Comment

                      Working...