OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Question external entities and relative URis

The spec says:

"relative URIs are relative to the location of the resource within which the
entity declaration occurs. This is defined to be the external entity containing
the '<' which starts the declaration, at the point when it is parsed as a
declaration. A URI might thus be relative to the document entity, to the entity
containing the external DTD subset, or to some other external parameter entity."

However, of external parsed entities it says: "When an XML processor recognizes
a reference to a parsed entity, in order to validate  the document, the
processor MUST  include  its replacement text."

If you have a DTD that declares some external (parameter, lets say) entity, the
URI is relative to that of the DTD, correct? The replacement text is to be
inserted verbatum (plus a leading and trailing space) into the DTD when
referenced like %ref; and parsed like normal. But if that external entity itself
contains external declarations, when they're parsed, now that they are included
into the DTD, won't any relative URIs in them be interpreted as being relative
to the URI of the DTD and not URI of the entity file they were declared in? 

Here is what I mean:
<!ENTITY % external-one SYSTEM "../entity/external-one.ent">

<!ENTITY % external-two SYSTEM "external-two.ent">

When entity-one is included by test.dtd, won't the relative URI in the
declaration of external-two be taken as being relative to /xml/testing/test.dtd
and not /xml/entity/external-one.ent?

Do I have the right idea?

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS