Q: Using XML entities for href's

Steffen Rodig rodig at sdm.de
Mon Mar 2 18:03:24 GMT 1998


Richard, I can't even believe it: I am just reading your book
"Presenting XML"! This is way cool!

> In message <199803021453.PAA28485 at sunfi1.fi.sdm.de>, Steffen Rodig
> <rodig at sdm.de> writes
>>In my xml based application I want to write xml documents with some
>>kind of indirect links, since I don't know the exact location of a
>>link target at the time a document is created and stored into a
>>repository. I got the idea to use the entity concept of xml for doing
>>this, since in my understanding entities can be used as virtual
>>identifiers for physical locations. So at the time I request a
>>document from the repository I'd like to include some entity
>>definitions into the internal DTD of a document. Then it would
>>look like this:
>>
>><?XML VERSION="1.0"?>
>><!DOCTYPE CP-Document PUBLIC "-//SDM SHORE//DTD CP-Document//EN" [
>><!ENTITY aRef SYSTEM "http://aServer/aDocument#anElement">
>>]>
>>...
>><aTag xml-link=simple href=aRef>content</aTag>

> There are two possible lines of attack suggested by XML itself (as
> against XLL, which uses URLs as its targets without the need for an
> entity declaration as in your example).

Ok, without the need, but also without the possibility?

> The PUBLIC identifier (of which you give an example above, in the
> external entity declaration of your external DTD subset) is intended to
> be a generic name which is not bound to a physical location.
> Philosophically, this is exactly what you want.

> Unfortunately, in XML (unlike SGML) you can't just specify a PUBLIC
> identifier - you have to give a system identifier as well.  (So, in
> fact, your
>><!DOCTYPE CP-Document PUBLIC "-//SDM SHORE//DTD CP-Document//EN" [
> is not correct.)

Do I understand it correctly: Even if I use a catalog file which maps
the public identifier for the dtd to its physical file name, I cannot
extend the dtd with this kind of internal dtd subset (entity
definitions)?

When I read the formal xml spec, it seems to be possible.

I am sorry, that I don't quite understand your answer. All I need is
a level of indirection for the href attributes. However, the correct
syntax probably would be

<aTag xml-link="simple" href="&aRef;">content</aTag>

> Which brings us on to system identifiers, since you have to have one
> anyway ;-)

> The finalized XML Recommendation talks of these system identifiers being
> a 'URI', as against a URL.  I remember a few years ago that URIs were
> going to include URNs (Uniform Resource Names) as well as the URLs we
> have grown to know and love.  URNs are (were?) like public identifiers
> in not being closely-coupled to a physical storage location.  I think
> that work is being done to update the definition of URIs to provide this
> kind of flexibility.

So does this mean in the end, that there will be times coming that this
will work?
The current status of the Linking Specification, however, tells me that a
LOCATOR has to be a URL only (with possible XPointer extensions). :-(

In case that it doesn't work, how come that with XML one gets levels of
indirection (and therefore independence from the physical location) almost
everywhere (e.g. for DTDs, for extern documents), but not for links?

Best,
--
Steffen Rodig                |s  |d &|m  |  software design & management
Steffen.Rodig at sdm.de         |   |   |   |  GmbH & Co. KG
http://www.sdm.de/           |   |   |   |  Thomas-Dehler-Str. 27
Tel/Fax +49-89-63812-395/490 |   |   |   |  81737 Muenchen, Germany

                  Leben ist das, was einem zustoesst,
         waehrend man auf die Erfuellung seiner Traeume wartet.


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list