please pardon me if this is too simple question, since I am just a beginner in this field.
My client used to work with a dtd, called “article.dtd” for a long time. Now they decided to extend that dtd a little bit, with some more elements and rename it as “project.dtd”. Since the new elements added to the article.dtd is of just a few lines, they don’t want to copy everything from article.dtd everytime they create project.dtd.
Thus, I am seeking a way, if it is possible to reference article.dtd from newly-created project.dtd, and in project.dtd, we only need to put in those lines that are not contained in article.dtd?
FYI, these are the four lines that are added in project.dtd:
<!ELEMENT project (title, keywords?, feature?, related-terms?, abstract?, classification?, contributor*, reviewer?, materials?, body, related-links?, questions?)>
<!ATTLIST project %common-atts; %status-atts; %profile-atts;>
<!ELEMENT abstract ((%para-elems;)+)>
<!ATTLIST abstract %common-atts;>
Thanks for the help in advance.
Yes, you can do this with a parameter entity. (It looks like you’re using a lot of parameter entities already.)
You will need to add a parameter entity declaration (
<!ENTITY % entity-name ...>) and a parameter entity reference (%entity-name;).Here’s an example using the entity name
article-dtd. This would be your completeproject.dtd:I only used a SYSTEM identifier in the entity declaration, but you can add a PUBLIC identifier too.
Example: