XHTML DTD

Discussion in 'HTML' started by David Manheim, Jul 14, 2005.

  1. I am writing an XHTML extension, to add some attributes to all xhtml
    objects, so that for any object, I can have "<a href="http://aol.com"
    text="This is a note that is useful for me">

    I tried the following dtd, and I'm not sure why it won't work: it
    accepts the html tags in the file, but not any of the extended tags.
    I'm not sure why. If anyone could help me out a bit, it would be much
    appreciated!

    ____________________base-aaa.dtd_______________________

    <!ENTITY % aaa-attrs
    "required (true | false) #IMPLIED
    readonly (true | false) #IMPLIED
    random %Text; #IMPLIED"


    <!ENTITY % xhtml11.dtd
    PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/D TD/xhtml11.dtd" >
    %xhtml11.dtd;

    <!-- Then add aaa-attrs to the common attributes -->

    <!ENTITY % Common.attrib
    "%Core.attrib;
    %I18n.attrib;
    %Events.attrib;
    %aaa-attrs.attrib;"
    David Manheim, Jul 14, 2005
    #1
    1. Advertising

  2. David Manheim wrote:

    > I am writing an XHTML extension, to add some attributes to all xhtml
    > objects, so that for any object, I can have "<a href="http://aol.com"
    > text="This is a note that is useful for me">
    >
    > I tried the following dtd, and I'm not sure why it won't work: it
    > accepts the html tags in the file, but not any of the extended tags.
    > I'm not sure why. If anyone could help me out a bit, it would be much
    > appreciated!
    >
    > ____________________base-aaa.dtd_______________________
    >
    > <!ENTITY % aaa-attrs
    > "required (true | false) #IMPLIED
    > readonly (true | false) #IMPLIED
    > random %Text; #IMPLIED"
    >
    >
    > <!ENTITY % xhtml11.dtd
    > PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    > "http://www.w3.org/TR/xhtml11/D TD/xhtml11.dtd" >
    > %xhtml11.dtd;
    >
    > <!-- Then add aaa-attrs to the common attributes -->
    >
    > <!ENTITY % Common.attrib
    > "%Core.attrib;
    > %I18n.attrib;
    > %Events.attrib;
    > %aaa-attrs.attrib;"


    I guess your post is missing the end... From what I can see so far:

    You must declare your version of 'Common.attrib' before you reference the
    XHTML DTD.
    An entity declaration is ignore, if the entity already exist. So in order to
    'override' something from the original DTD, you must make your declarations
    before referencing it.

    On a side note: I used the Core.extra.attrib entity for custom attributes
    shared by all elements. As this is empty by default, you won't have to
    'copy'n modify' stuff from the DTD. And I guess that's the preferred and
    intended way to do this.


    --
    Benjamin Niemann
    Email: pink at odahoda dot de
    WWW: http://www.odahoda.de/
    Benjamin Niemann, Jul 14, 2005
    #2
    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. Joseph Tilian
    Replies:
    0
    Views:
    348
    Joseph Tilian
    Dec 21, 2004
  2. Ronald Fischer
    Replies:
    4
    Views:
    1,752
    Ronald Fischer
    Mar 17, 2005
  3. Rafal 'Raf256' Maj

    non-valid XHTML DTD

    Rafal 'Raf256' Maj, Sep 3, 2004, in forum: HTML
    Replies:
    3
    Views:
    515
    Jukka K. Korpela
    Sep 3, 2004
  4. David  Manheim

    XHTML DTD

    David Manheim, Jul 14, 2005, in forum: XML
    Replies:
    1
    Views:
    484
    David Carlisle
    Jul 14, 2005
  5. test
    Replies:
    2
    Views:
    2,015
    Oliver Wong
    Jul 28, 2006
Loading...

Share This Page