Discussion in 'XML' 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"
    random="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.


    <!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" >

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

    <!ENTITY % Common.attrib
    David Manheim, Jul 14, 2005
    1. Advertisements

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

    Wrong order.

    In a DTD the first definition wins, so you need to define the parameter
    entity first then the one in the xhtml dtd will be ignored, but since
    you need to define any entities that you use in your definition it's
    easier to tap in to a lower level entity, in particular


    has a default definition of empty and is there for
    exactly this reason.

    David Carlisle, Jul 14, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.