[topicmapmail] variantName for resourceRef?

Murray Altheim m.altheim@open.ac.uk
Tue, 29 Apr 2003 10:41:02 +0100


Thomas B. Passin wrote:
> [Murray Altheim]
[...]
>>>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.

Actually, non-validating parsers are required to parse and process
the internal subset and its external entities according to the
rules in [1]. The only thing a developer would have to check is in
the XML declaration. If it has a "standalone document declaration"
[2] (simply an attribute 'standalone') whose value is "yes", any
external entities can be safely ignored. Now, this might not actually
be true, but it is what the document is claiming.

     <?xml version="1.0" standalone="yes" ?>
     <!DOCTYPE topicMaps PUBLIC "...

Otherwise, one can rely on internal subset and the declaration
and instantiation of its external entities. The external subset
is what most people think of as "the DTD", and yes, non-validating
parsers don't have to read it.

Murray

[1] http://www.w3.org/TR/REC-xml#proc-types
[2] http://www.w3.org/TR/REC-xml#NT-SDDecl
......................................................................
Murray Altheim                    http://kmi.open.ac.uk/people/murray/
Knowledge Media Institute
The Open University, Milton Keynes, Bucks, MK7 6AA, UK               .

                                                Moonlight slanting
                                                  through all the
                                                  bamboo forest...
                                                and nightingale song
                                                          -- Basho