Re: issue with relative URIs in the DOM

Curt wrote:
> After a little reflection, it seems that DOM isn't the only 
> technology that may discard the information necessary to 
> resolve relative URI's in entity references.  XSLT is required 
> to present a document object model that has entity references 
> expanded.

XSLT extends the data model to retain the base URI information.  We already
plan to note in the draft that the XPath data model of itself is
insufficient to represent relative URIs correctly.  This also applies to
minimal DOM implementations.  The XSLT data model is sufficient, but needs
to be made xml:base-aware.

> That would  make it impossible for an XSLT transform
> to correctly absolutize URI's or generate xml:base attributes
> in documents that had external entities that had different 
> base URI's (until something like the resolve function 
> suggested in features under consideration is available).

This capability is represented by an item under Appendix G (features under
consideration for future versions) in the XSLT draft.

> The xml:base in the following example would only come into 
> play in an entity expanding processor, but would result in 
> URI references in the entity to be uniformly interpreted.
>
> <!DOCTYPE ...[
>   <!ENTITY xmlconf SYSTEM 'xmlconf/xmlconf.xml'>
> ]>
> <TESTSUITE>
>   <TESTCASES xml:base="xmlconf/">
>     &xmlconf;
>   </TESTCASES>
> </TESTSUITE>

This may work in many situations.

- Jonathan Marsh

Received on Thursday, 20 July 2000 14:27:19 UTC