Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

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.


<!ENTITY % aaa-attrs
"required    (true | false)    #IMPLIED
readonly    (true | false)    #IMPLIED
random        %Text;        #IMPLIED"
Quoted text here. Click to load it

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

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

<!ENTITY % Common.attrib
Quoted text here. Click to load it



Quoted text here. Click to load it


Quoted text here. Click to load it

Without any deeper analysis I have the feeling that it might be caused
by the fact that the entity 'Common.attrib' is already defined in the
original DTD.

According to SGML rules, once an entity is defined it can not be
redefined at a later stage in the parse.



Kind of; I did need it to be put earlier in the file, before i imported
the XHTML dtd, so that when XHTML imports Common.attrib, it imports
mine, which is predefined, instead of it's own.. Of course, it still
doesn't work at all, and I'm not sure why.


Quoted text here. Click to load it

Defining Common.attrib before you include the XHTML 1.1 DTD
won't help since parameter entites must be defined before they are
used, and unless they are defined in the internal subset you will have
a lot of undefined PEs in Common.attrib. The %Text; PE reference you're
using in aaa-attrs is also undefined.
Furthermore, you define aaa-attrs but then you use %aaa-attrs.attrib;.

As David Carlisle said in your multi-posted message to comp.text.xml,
you can use Common.extra.attrib which is "empty" by default. However,
this won't really work either since the readonly attribute will be
defined twice for some element types.

David Hsther

Site Timeline