DTD? Is address element block or inline?

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

    DTD? Is address element block or inline?

    I'm trying to learn how to read a DTD I wanted to use,

    to ensure I was treating each element correctly in terms of being block,
    inline, or flow (either).

    <!ENTITY % block
    "P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT |
    BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">

    <!ENTITY % flow "%block; | %inline;">

    The way I read that was the block elements included ADDRESS. However
    the next item related to ADDRESS was

    <!ELEMENT ADDRESS - - (%inline;)* -- information on author -->
    <!ATTLIST ADDRESS
    %attrs; -- %coreattrs, %i18n, %events --[color=blue]
    >[/color]

    This seemed to me to be saying that the element ADDRESS requires opening
    and closing tags, is an INLINE element that can be left out, or used one
    or more times.

    Can anyone explain to me what I am misunderstandin g?

    --
    Eric Lindsay's web sites, featuring Airlie Beach diving, sailing tourist area, Psion Epoc computers, Gegenschein Science fiction fanzine.

  • Eric B. Bednarz

    #2
    Re: DTD? Is address element block or inline?

    Eric Lindsay <NOSPAmar2005@e riclindsay.com> writes:
    [color=blue]
    > I'm trying to learn how to read a DTD I wanted to use,
    > http://www.w3.org/TR/html4/strict.dtd[/color]

    Why? It hasn't any relevance for HTML. User agents who try to
    implement the HTML spec at all aim at its prose including all attached
    errors and are subsequently incompatible with the normative syntax.

    Anyway, if you want to understand SGMLese, locate a reference with some
    considerable clue-density (IOW, avoid W3C specs like the plague). A
    good place to start for the basics might be

    <http://www.hti.umich.e du/cgi/t/tei/tei-idx?type=extoc& byte=71769>

    Or just wade through

    <http://xml.coverpages. org/general.html>


    I don't see the point, though, except if you have plans to mangle a
    private DTD for usage in SGML aware authoring tools.

    [color=blue]
    > <!ELEMENT ADDRESS - - (%inline;)* -- information on author -->[/color]
    [color=blue]
    > This seemed to me to be saying that the element ADDRESS requires opening
    > and closing tags, is an INLINE element[/color]

    It can *contain* none or more instances of whatever is lumped together
    in the parameter entity inline (it would be a good thing to forget about
    the inconsistently used terms 'block' and 'inline' altogether in an HTML
    context, BTW).


    --
    ||| hexadecimal EBB
    o-o decimal 3771
    --oOo--( )--oOo-- octal 7273
    205 goodbye binary 111010111011

    Comment

    • Steve Pugh

      #3
      Re: DTD? Is address element block or inline?

      Eric Lindsay wrote:[color=blue]
      > I'm trying to learn how to read a DTD I wanted to use,
      > http://www.w3.org/TR/html4/strict.dtd
      > to ensure I was treating each element correctly in terms of being block,
      > inline, or flow (either).
      >
      > <!ENTITY % block
      > "P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT |
      > BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">
      >
      > <!ENTITY % flow "%block; | %inline;">
      >
      > The way I read that was the block elements included ADDRESS. However
      > the next item related to ADDRESS was
      >
      > <!ELEMENT ADDRESS - - (%inline;)* -- information on author -->
      > <!ATTLIST ADDRESS
      > %attrs; -- %coreattrs, %i18n, %events --[color=green]
      > >[/color]
      >
      > This seemed to me to be saying that the element ADDRESS requires opening
      > and closing tags, is an INLINE element that can be left out, or used one
      > or more times.[/color]

      No, it's saying that the content of the address element must be
      %inline.

      Steve

      Comment

      • Gus Richter

        #4
        Re: DTD? Is address element block or inline?

        Eric Lindsay wrote:[color=blue]
        > I'm trying to learn how to read a DTD I wanted to use,
        > http://www.w3.org/TR/html4/strict.dtd
        > to ensure I was treating each element correctly in terms of being block,
        > inline, or flow (either).[/color]

        There are just block or inline elements.
        Flow is an "entity" which may be either inline or block.
        [color=blue]
        > <!ENTITY % block
        > "P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT |
        > BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">[/color]

        This defines which elements are block type.
        The %heading, %list and %preformatted entities are expanded elewhere
        (permissable content type for each).
        [color=blue]
        > <!ENTITY % flow "%block; | %inline;">[/color]

        The % flow entity is defined to be either Block or Inline.
        [color=blue]
        > The way I read that was the block elements included ADDRESS.[/color]

        Correct. The ADDRESS element is defined to be block type.
        [color=blue]
        > However
        > the next item related to ADDRESS was
        >
        > <!ELEMENT ADDRESS - - (%inline;)* -- information on author -->
        > <!ATTLIST ADDRESS
        > %attrs; -- %coreattrs, %i18n, %events --[color=green]
        > >[/color][/color]

        The ADDRESS element may only _contain_ inline element(s) zero or more times.
        [color=blue]
        > This seemed to me to be saying that the element ADDRESS requires opening
        > and closing tags, is an INLINE element that can be left out, or used one
        > or more times.
        >
        > Can anyone explain to me what I am misunderstandin g?[/color]

        How to read the HTML DTD:
        <http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.3>

        --
        Gus

        Comment

        • Eric Lindsay

          #5
          Re: DTD? Is address element block or inline?

          In article <WbednVKd58a3ND zeRVn-gQ@golden.net>,
          Gus Richter <gusrichter@net scape.net> wrote:
          [color=blue]
          > Eric Lindsay wrote:[color=green]
          > > I'm trying to learn how to read a DTD I wanted to use,
          > > http://www.w3.org/TR/html4/strict.dtd
          > >
          > > <!ELEMENT ADDRESS - - (%inline;)* -- information on author -->[/color]
          >
          > The ADDRESS element may only _contain_ inline element(s) zero or more times.[color=green]
          > > Can anyone explain to me what I am misunderstandin g?[/color][/color]

          Thank you. The _contain_ was what I hadn't noticed and understood.
          [color=blue]
          > How to read the HTML DTD:
          > <http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.3>[/color]

          I think the explanation of how to read the HTML DTD was what I was
          having trouble with. I was reading (well, misreading, I guess)
          http://www.w3.org/TR/REC-html40/struct/global.html which seems about the
          same as the reference you kindly provided.

          --
          Eric Lindsay's web sites, featuring Airlie Beach diving, sailing tourist area, Psion Epoc computers, Gegenschein Science fiction fanzine.

          Comment

          • Eric Lindsay

            #6
            Re: DTD? Is address element block or inline?

            In article <m33bkucwzm.fsf @nntp.bednarz.n l>,
            Eric B. Bednarz <bednarz@fahr-zur-hoelle.org> wrote:
            [color=blue]
            > Eric Lindsay <NOSPAmar2005@e riclindsay.com> writes:
            >[color=green]
            > > I'm trying to learn how to read a DTD I wanted to use,
            > > http://www.w3.org/TR/html4/strict.dtd[/color]
            >
            > Why? It hasn't any relevance for HTML.[/color]

            I had seen comments elsewhere as to the irrelevance of the association
            between rendering web pages and SGML. Thanks to web pages from people
            who participate in this group about tag soup parsers, I also (now)
            realise that user agents are not going to run an SGML parser.

            However in trying to unlearn old bad habits about HTML and CSS, I keep
            finding tutorials and guides (and even books) that are just plain wrong.
            I've been advised previously in this group that reading the W3C pages
            and the DTD are the only way to be sure of what the standards actually
            say. So however flawed the combination of my lack of understand and the
            differences of the standard from the reality of web pages in general, it
            still seems a better way to learn how to write a standards compliant web
            page than reading some of the tutorials.

            I have tried about 25 HTML editors recently (not yet through them all).
            So far all of the HTML editors I have tried have left me free to write
            web pages that are not standards compliant. They mostly provided
            minimal guidance as to allowed elements and attributes at any stage in
            writing (despite the pick lists). I could just keep writing my pages in
            vi and TextEdit, but it increasingly seems plain silly not to have
            better tools than that 15 years after the web appeared.

            So I thought I would prototype up some sort of content management system
            and web page generator for myself. The result should be easier for me
            than just using a text editor. More importantly, by prototyping, I get
            a better idea of what I really need to be looking for in editors and
            CMS. I was contemplating extracting my pick lists for generating pages
            direct from the DTD. Hence the need to understand it.
            [color=blue]
            > Anyway, if you want to understand SGMLese[/color]

            I really would prefer not to have to extend into that area, if I can
            learn enough to pull apart a DTD without doing so. Thank you for the
            helpful references however.
            [color=blue]
            > I don't see the point, though, except if you have plans to mangle a
            > private DTD for usage in SGML aware authoring tools.[/color]

            I hope I never do anything that elaborate.

            --
            Eric Lindsay's web sites, featuring Airlie Beach diving, sailing tourist area, Psion Epoc computers, Gegenschein Science fiction fanzine.

            Comment

            • Eric B. Bednarz

              #7
              Re: DTD? Is address element block or inline?

              Eric Lindsay <NOSPAmar2005@e riclindsay.com> writes:
              [color=blue]
              > However in trying to unlearn old bad habits about HTML and CSS, I keep
              > finding tutorials and guides (and even books) that are just plain wrong.[/color]

              You don't say. :^)
              [color=blue]
              > I've been advised previously in this group that reading the W3C pages
              > and the DTD are the only way to be sure of what the standards actually
              > say.[/color]

              Right. But, erm... What *standards*?
              The W3C HTML 4.01 recommendation is a fine common denominator to start
              with, as long as you don't take its normative references to real
              standards all too serious.
              [color=blue]
              > I have tried about 25 HTML editors recently (not yet through them all).
              > So far all of the HTML editors I have tried have left me free to write
              > web pages that are not standards compliant.[/color]

              Oh if that's all you want...

              <http://aquamacs.org/> (I suppose your user-agent field isn't forged ;-)

              I suggest writing XHTML in nxml mode, schema-validates while you type
              out of the box. You may prefer to use a XHTML 1.0 strict schema instead
              of the XHTML modules, you can translate the DTD to RELAX NG with trang:

              <http://www.thaiopensou rce.com/relaxng/trang.html>


              For text/html, old-fashioned PSGML (parses the document type declaration
              and provides contextual editing based upon that) might be more
              appropriate but also way more difficult to set up to its full potential
              (*especially* on OS X, which is little more than pretty fonts on an
              inherently broken file system).


              --
              ||| hexadecimal EBB
              o-o decimal 3771
              --oOo--( )--oOo-- octal 7273
              205 goodbye binary 111010111011

              Comment

              • Eric Lindsay

                #8
                Re: DTD? Is address element block or inline?

                In article <m3y82mapum.fsf @nntp.bednarz.n l>,
                Eric B. Bednarz <bednarz@fahr-zur-hoelle.org> wrote:
                [color=blue]
                > Eric Lindsay <NOSPAmar2005@e riclindsay.com> writes:[/color]
                [color=blue]
                > Right. But, erm... What *standards*?
                > The W3C HTML 4.01 recommendation is a fine common denominator to start
                > with[/color]

                HTML 4.01 Strict for the moment. My old pages are close enough that I
                can get them to comply within a reasonable time span. I did a light
                HTML and CSS makeover about 4-5 years ago, based on advice from this
                group back then.

                I can not see any point in moving to XHTML if it was just going to be
                served as text/html to ensure IE displays a page. I sort of figure I
                will be back in this news group in about 5 years asking about updating
                to XML.
                [color=blue][color=green]
                > > So far all of the HTML editors I have tried have left me free to write
                > > web pages that are not standards compliant.[/color]
                >
                > Oh if that's all you want...[/color]

                Well, it is not all I want, but it is a part of this move. The main
                point of this move is to get my web site update routine to a point where
                it isn't any worse than I had 10 years ago at a university.
                [color=blue]
                > <http://aquamacs.org/> (I suppose your user-agent field isn't forged ;-)[/color]

                I never did get into Emacs, so I hadn't even put it on my list of
                editors to check. Thanks for pointing out Aquamacs. No, the user agent
                isn't forged. I really should add the Eric conspiracy secret labs
                header however. Thanks for reminding me of that also.
                [color=blue]
                > I suggest writing XHTML in nxml mode, schema-validates while you type
                > out of the box. You may prefer to use a XHTML 1.0 strict schema instead
                > of the XHTML modules, you can translate the DTD to RELAX NG with trang:
                >
                > <http://www.thaiopensou rce.com/relaxng/trang.html>[/color]

                That sounds pretty good, if I do go with XHTML. The URL won't open, but
                it looks like information on trang is widespread. Thanks.
                [color=blue]
                > For text/html, old-fashioned PSGML (parses the document type declaration
                > and provides contextual editing based upon that) might be more
                > appropriate but also way more difficult to set up to its full potential
                > (*especially* on OS X, which is little more than pretty fonts on an
                > inherently broken file system).[/color]

                Thanks very much for pointing out PSGML, which I didn't realise even
                existed. The first page of Google hits listed someone I know mentioning
                PSGML in the comp sci lecture notes they give. I'll ask them whether
                they actually use it on their Macintosh. Speaking of which, the major
                alternative left me wanting to defenestrate my computer, so that left me
                without many choices.

                --
                Eric Lindsay's web sites, featuring Airlie Beach diving, sailing tourist area, Psion Epoc computers, Gegenschein Science fiction fanzine.

                Comment

                • Eric B. Bednarz

                  #9
                  Re: DTD? Is address element block or inline?

                  Eric Lindsay <NOSPAmar2005@e riclindsay.com> writes:
                  [color=blue]
                  > I can not see any point in moving to XHTML if it was just going to be
                  > served as text/html to ensure IE displays a page.[/color]

                  I have mixed feelings about that; XML on the web is doomed to be a
                  failure alright, but XML _can_ help in the authoring process. The point
                  is, most people 'using' XHTML don't use *any* XML tools at all, and it
                  can't get worse beyond that.

                  OTOH, appendix C compatible XHTML is not really more bogus than *any*
                  HTML pretending to be SGML. It's only human to resort to the lies you
                  learned first.

                  And even with low(est)spec PHP 4 there's commonly some basic expat stuff
                  that is useful for CMSing against hard rules (often without any
                  further transformation support). Which can make XHTML useful even if
                  you are stuck with it as 'the' output format (bogus XML compared to
                  bogus SGML, really, dear kids, who actually cares?).
                  [color=blue]
                  > I never did get into Emacs,[/color]

                  Shame on you :^)
                  [color=blue][color=green]
                  >> <http://www.thaiopensou rce.com/relaxng/trang.html>[/color]
                  >
                  > That sounds pretty good, if I do go with XHTML. The URL won't open,[/color]

                  Oh, not again. I can mail the 1.0 schemas if you need them, you
                  probably would not need trang beyond that anyway.
                  [color=blue]
                  > Thanks very much for pointing out PSGML, which I didn't realise even
                  > existed.[/color]

                  Oh dear. :) It's a bit dated (without hope) though.
                  Tragically, PSGMLed Emacs is by far the best editor to actually learn
                  HTML (or any old-fashioned supposedly DTD-based markup dialect) and at
                  the same time widely unknown to the public.

                  Comment

                  • Leonard Blaisdell

                    #10
                    Re: DTD? Is address element block or inline?

                    In article <NOSPAmar2005-5366BD.08521317 122005@freenews .iinet.net.au>,
                    Eric Lindsay <NOSPAmar2005@e riclindsay.com> wrote:
                    [color=blue]
                    > In article <m3y82mapum.fsf @nntp.bednarz.n l>,
                    > Eric B. Bednarz <bednarz@fahr-zur-hoelle.org> wrote:[/color]
                    [color=blue][color=green]
                    > > (*especially* on OS X, which is little more than pretty fonts on an
                    > > inherently broken file system).[/color][/color]
                    [color=blue]
                    > I'll ask them whether
                    > they actually use it on their Macintosh. Speaking of which, the major
                    > alternative left me wanting to defenestrate my computer, so that left me
                    > without many choices.[/color]

                    Perhaps Mr. Bednarz would enlighten _me_ in <news:comp.sys. mac.sys>.
                    That seems an appropriate forum in which to trash Macs without going to
                    the extreme of advocacy. Far more savvy people than I will be happy to
                    argue his *broken file system* statement. And some may even agree. I
                    might learn something. But not here.

                    leo

                    --
                    <http://web0.greatbasin .net/~leo/>

                    Comment

                    • Eric Lindsay

                      #11
                      Re: DTD? Is address element block or inline?

                      In article <m2vexosid5.fsf @email.bednarz. nl>,
                      Eric B. Bednarz <bednarz@fahr-zur-hoelle.org> wrote:
                      [color=blue]
                      > Eric Lindsay <NOSPAmar2005@e riclindsay.com> writes:
                      > I have mixed feelings about that; XML on the web is doomed to be a
                      > failure alright, but XML _can_ help in the authoring process. The point
                      > is, most people 'using' XHTML don't use *any* XML tools at all, and it
                      > can't get worse beyond that.[/color]

                      I see your point. XML looks simple enough to write by hand, so the
                      temptation to do just that is always there. Even though I know tool
                      generation is the only way to go. I wonder whether that temptation to
                      hand adjust was in the minds of the Apple people when they changed some
                      of their XML files into binary (I'm pretty sure they only compressed the
                      files).

                      Somehow I never had the feeling that mainstream XML tools were readily
                      available to me, despite the odd magazine cover disk with Oxygen on it.
                      While listening to Bill Humphries talk about XML would enthuse me for a
                      time, actually using XML seemed just way too hard.
                      [color=blue]
                      > And even with low(est)spec PHP 4 there's commonly some basic expat stuff
                      > that is useful for CMSing against hard rules (often without any
                      > further transformation support). Which can make XHTML useful even if
                      > you are stuck with it as 'the' output format (bogus XML compared to
                      > bogus SGML, really, dear kids, who actually cares?).[/color]

                      Looking around tonight, I happened to notice the Mac has textutil. The
                      text to html conversions it does seem to be valid, with an HTML 4.01
                      Strict Doctype. It didn't even do that bad a job when I fed it an HTML
                      file - kept most of the head, for instance, and the headers (did alas
                      throw away the URLs). Even the CSS isn't impossibly bad. Plus tidy is
                      already installed to work on the output. Most of the rest of my CMS is
                      just little scripts. A little loop to cat boilerplate files together
                      according to a pseudo make file, a few variables to change on the way
                      through. Curl and the html validator. Ftp with a here file. I guess
                      I'll see how far that will take me. Just prototyping at this stage
                      anyway.
                      [color=blue]
                      > Oh dear. :) It's a bit dated (without hope) though.
                      > Tragically, PSGMLed Emacs is by far the best editor to actually learn
                      > HTML (or any old-fashioned supposedly DTD-based markup dialect) and at
                      > the same time widely unknown to the public.[/color]

                      On a more careful reading, the tutorial in which my comp sci lecturer
                      friend mentioned PSGML dates from 1995.

                      --
                      Eric Lindsay's web sites, featuring Airlie Beach diving, sailing tourist area, Psion Epoc computers, Gegenschein Science fiction fanzine.

                      Comment

                      • Eric B. Bednarz

                        #12
                        Re: DTD? Is address element block or inline?

                        Leonard Blaisdell <leo@greatbasin .com> writes:
                        [color=blue]
                        > Perhaps Mr. Bednarz would enlighten _me_ in <news:comp.sys. mac.sys>.[/color]

                        Mr. Bednarz apparently preferred to enjoy his weekend.
                        [color=blue]
                        > That seems an appropriate forum in which to trash Macs without going to
                        > the extreme of advocacy. Far more savvy people than I will be happy to
                        > argue his *broken file system* statement. And some may even agree. I
                        > might learn something. But not here.[/color]

                        Thanks, but no thanks. The only thing on earth that I can imagine to be
                        even less appealing than arguing with Linux bigots is arguing with Apple
                        fangirls. I wouldn't consider one snippy remark in parentheses an
                        invitation for discussion, BTW; I see propaganda on less solid ground
                        (remarks about bad performance of HFS+ in general and incompatibility
                        with Unix in particular shouldn't really come as a shock these days)
                        aimed at Redmond flying under the political correction radar every other
                        day, here, there and everywhere.


                        --
                        ||| hexadecimal EBB
                        o-o decimal 3771
                        --oOo--( )--oOo-- octal 7273
                        205 goodbye binary 111010111011

                        Comment

                        • Leonard Blaisdell

                          #13
                          Re: DTD? Is address element block or inline?

                          In article <m37ja2gn1a.fsf @nntp.bednarz.n l>,
                          Eric B. Bednarz <bednarz@fahr-zur-hoelle.org> wrote:
                          [color=blue]
                          > Mr. Bednarz apparently preferred to enjoy his weekend.[/color]

                          Certainly a better use of ones time :-) I get a little sensitive about
                          my OS sometimes. But my post was impertinent. Forgive me.

                          leo

                          --
                          <http://web0.greatbasin .net/~leo/>

                          Comment

                          Working...