[topicmapmail] variantName for resourceRef?

Thomas B. Passin tpassin@comcast.net
Mon, 28 Apr 2003 23:30:41 -0400


[Murray Altheim]
> [a short tutorial follows...]
>
> Thomas B. Passin wrote:
> >>Is there a way to shorten what is displayed by somehow using a fit-all
> >>string like "Astrostats" instead of the whole URL?
> >
> > You could define entities in an internal DTD -
> >
> > <!ENTITY astro
> > "http://avyakta.caltech.edu:8090/omnigator/models/topic_complete.jsp">
> >
> > ...
> > <resourceRef xlink:href='&astro;?tm=galaxies_s.xtm&id=astrostat'/>
> >
> > Remember, in the parsed xml document, the entities get replaced by their
> > replacement text so you have not really changed anything about the URL.
>
> Just to amplify Tom's reply, this is called the "internal subset" in SGML
> and XML, and works on a per-document basis -- each document may optionally
> have markup declarations (e.g., for elements, attributes and entities)
> as part of its DOCTYPE declaration. If you want to generalize this, you
> can put those markup declarations into a file, consider it as a DTD
> "module" (this is considered part of the document's "prolog"), then
> declare and instantiate the module.

Thanks to Murray for fleshing out my suggestion.  Just one thing to
remember, though.  A non-validating parser does not actually have to read
the external subset, so you cannot be sure it will (depends on the
particular parser model).  If you use a validating parser, you have to
include a complete DTD or the topic map will not validate.  That is why I do
not favor putting this kind of entity into an external DTD.  Of course, if
you know that your parser will in fact read the external subset of the DTD,
you are all set to use one.

Cheers,

Tom P