Can you add additional elements to XHTML 1.0 page?

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

    Can you add additional elements to XHTML 1.0 page?

    I'm assuming there's a way to do the following, but I'm having trouble
    finding good information on it. If someone could point me to a good
    webpage on it...

    I want to take a Valid XHTML 1.0 page and add some elements to it.

    Example: Let's say I want to add the elements "DATE" and "TEXT" to an
    XHTML page as in the following:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>exampl e</title>
    </head>
    <body>
    <table>
    <tr>
    <td><DATE>200 5-05-18</DATE></td>
    <td><TEXT>Tes t Text 1</TEXT></td>
    </tr>
    <tr>
    <td><DATE>200 5-05-19</DATE></td>
    <td><TEXT>Tes t Text 2</TEXT></td>
    </tr>
    </table>
    </body>
    </html>

    How would I do this? Is there a way to do it where it could still
    validate as XHTML 1.0 Strict?

    I tried adding [<!ELEMENT DATE (CDATA)> <!ELEMENT TEXT (CDATA)>] to the
    DOCTYPE tag, but it created two problems:

    1) It would at ]> at the top of my webpage.
    2) I got errors when validating saying I couldn't add those elements in
    those places (i.e. within <td> tags).


    --
    [ Sugapablo ]
    [ http://www.sugapablo.net <--personal | http://www.sugapablo.com <--music ]
    [ http://www.2ra.org <--political | http://www.subuse.net <--discuss ]

  • Henri Sivonen

    #2
    Re: Can you add additional elements to XHTML 1.0 page?

    In article <pan.2005.05.19 .13.51.29.55596 7@REMOVEsugapab lo.com>,
    Sugapablo <russ@REMOVEsug apablo.com> wrote:
    [color=blue]
    > I want to take a Valid XHTML 1.0 page and add some elements to it.
    >
    > Example: Let's say I want to add the elements "DATE" and "TEXT" to an
    > XHTML page as in the following:[/color]
    ....[color=blue]
    > Is there a way to do it where it could still
    > validate as XHTML 1.0 Strict?[/color]

    So basically you are asking if there is a way to take something that is
    not XHTML 1.0 Strict and validate it as XHTML 1.0 Strict. What's the
    point?

    --
    Henri Sivonen
    hsivonen@iki.fi

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

    Comment

    • Sugapablo

      #3
      Re: Can you add additional elements to XHTML 1.0 page?

      On Thu, 19 May 2005 17:29:44 +0300, Henri Sivonen wrote:
      [color=blue]
      > So basically you are asking if there is a way to take something that is
      > not XHTML 1.0 Strict and validate it as XHTML 1.0 Strict. What's the
      > point?[/color]

      I was under the impression that this was the whole point of XHTML. To
      "permit the combination of existing and new feature sets when developing
      content". (http://www.w3.org/TR/xhtml1/#why)

      --
      [ Sugapablo ]
      [ http://www.sugapablo.net <--personal | http://www.sugapablo.com <--music ]
      [ http://www.2ra.org <--political | http://www.subuse.net <--discuss ]

      Comment

      • Henri Sivonen

        #4
        Re: Can you add additional elements to XHTML 1.0 page?

        In article <pan.2005.05.19 .14.48.52.28152 0@REMOVEsugapab lo.com>,
        Sugapablo <russ@REMOVEsug apablo.com> wrote:
        [color=blue]
        > On Thu, 19 May 2005 17:29:44 +0300, Henri Sivonen wrote:
        >[color=green]
        > > So basically you are asking if there is a way to take something that is
        > > not XHTML 1.0 Strict and validate it as XHTML 1.0 Strict. What's the
        > > point?[/color]
        >
        > I was under the impression that this was the whole point of XHTML. To
        > "permit the combination of existing and new feature sets when developing
        > content". (http://www.w3.org/TR/xhtml1/#why)[/color]

        Then you've got something in the "XHTML family" but not specifically 1.0
        Strict.

        --
        Henri Sivonen
        hsivonen@iki.fi

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

        Comment

        • Jim Jaworski

          #5
          Re: Can you add additional elements to XHTML 1.0 page?

          Sugapablo wrote:[color=blue]
          > I'm assuming there's a way to do the following, but I'm having trouble
          > finding good information on it. If someone could point me to a good
          > webpage on it...
          >
          > I want to take a Valid XHTML 1.0 page and add some elements to it.
          >
          > Example: Let's say I want to add the elements "DATE" and "TEXT" to an
          > XHTML page as in the following:
          >
          > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
          > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
          > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
          > <head>
          > <title>exampl e</title>
          > </head>
          > <body>
          > <table>
          > <tr>
          > <td><DATE>200 5-05-18</DATE></td>
          > <td><TEXT>Tes t Text 1</TEXT></td>
          > </tr>
          > <tr>
          > <td><DATE>200 5-05-19</DATE></td>
          > <td><TEXT>Tes t Text 2</TEXT></td>
          > </tr>
          > </table>
          > </body>
          > </html>
          >
          > How would I do this? Is there a way to do it where it could still
          > validate as XHTML 1.0 Strict?
          >
          > I tried adding [<!ELEMENT DATE (CDATA)> <!ELEMENT TEXT (CDATA)>] to the
          > DOCTYPE tag, but it created two problems:
          >
          > 1) It would at ]> at the top of my webpage.
          > 2) I got errors when validating saying I couldn't add those elements in
          > those places (i.e. within <td> tags).[/color]

          The way to do this is to create new CLASSes, not new XHTML elements,
          like so:

          In your <head></head> section, add the following:

          ..date {
          font-family: Arial, serif;
          font-size: 1.0em;
          color: red;
          }
          ..text {
          font-size: 1.0em;
          }

          In your <body></body> section, code like this:
          <tr>
          <td class="date">Th ursday, May 19, 2005</td>
          <td class="text">Hi , how's it going, eh?</td>
          </tr>

          Comment

          • Soren Kuula

            #6
            Re: Can you add additional elements to XHTML 1.0 page?

            Sugapablo wrote:[color=blue]
            >
            > How would I do this? Is there a way to do it where it could still
            > validate as XHTML 1.0 Strict?[/color]

            No, once you change the document type to something else than XHTML, then
            it is not XHTML ;-)
            [color=blue]
            > I tried adding [<!ELEMENT DATE (CDATA)> <!ELEMENT TEXT (CDATA)>] to the
            > DOCTYPE tag, but it created two problems:[/color]

            A nicer solution would be to put your additions into a different
            namespace. A problem with that is then that DTD and DTD-based does not
            know what namespaces are :(

            What do you want to use your extensions for anyway? No common software
            "out there" that is designed to operate with XHTML will understand your
            extensions.

            If you want to put some data into XHTML documents that you can't express
            well enough in XHTML (for example, because you need to be able to find
            your dates again, and XHTML has nothing to express dates), you could:

            - be careful to keep all XHTML in the XHTML namespace
            - be careful to keep all your extensions in your own namespace
            - write documents where you mix the two together. They probably won't be
            possible to validate with a DTD-based validator...
            - write an XSLT transformation that translates your extensions into
            XHTML. After transformation, any information that "this is a date" etc.
            will be lost -- but you still have the original mixed document, and the
            transform result is pure XHTML, and you can verify that it is by
            validation. If some of your extension information should not be
            presented as XHTML, your transform can just throw it out.

            Soren

            Comment

            • Sugapablo

              #7
              Re: Can you add additional elements to XHTML 1.0 page?

              On Thu, 19 May 2005 15:19:20 -0500, Jim Jaworski wrote:

              [color=blue]
              > The way to do this is to create new CLASSes, not new XHTML elements[/color]

              That's not bad at all. :) Thanks.

              --
              [ Sugapablo ]
              [ http://www.sugapablo.net <--personal | http://www.sugapablo.com <--music ]
              [ http://www.2ra.org <--political | http://www.subuse.net <--discuss ]

              Comment

              • Peter Flynn

                #8
                Re: Can you add additional elements to XHTML 1.0 page?

                Sugapablo wrote:
                [color=blue]
                > On Thu, 19 May 2005 17:29:44 +0300, Henri Sivonen wrote:
                >[color=green]
                >> So basically you are asking if there is a way to take something that is
                >> not XHTML 1.0 Strict and validate it as XHTML 1.0 Strict. What's the
                >> point?[/color]
                >
                > I was under the impression that this was the whole point of XHTML. To
                > "permit the combination of existing and new feature sets when developing
                > content". (http://www.w3.org/TR/xhtml1/#why)[/color]

                Yes, you certainly can. But the result won't be XHTML 1.0. It'll be some
                document type of your own making. You can validate it if you create a DTD
                or Schema based on XHTML 1.0 and add your specified modifications. The
                modular version of XHTML (http://www.w3.org/TR/xhtml11/) lets you add and
                subtract...but you'll still have to call the result "Russ's Modified XHTML"
                or something like, because it won't be standard XHTML any more.

                Lots of people do this with modular document types, of which the two biggest
                and best known are DocBook and TEI. There's a whole section in the chapter
                on DTDs in my book on SGML and XML Tools [1] which describes the process
                using DocBook as an example, and the DTD for the XML FAQ is a small example
                of this (http://xml.silmaril.ie/faq.dtd).

                ///Peter
                --
                1. Flynn, P. Understanding SGML and XML Tools, Kluwer, Boston, 1998. ISBN:
                0-7923-8169-6

                Comment

                Working...