Pathnames

Practical XML provides a flexible distributed document system, allowing single or multiple documents to be published in web and print formats. Aims of the system include allowing documents to be stored in the same directory subtree as other types of information (eg source and binary code), and permitting sub-trees to be relocatable. Documents can be web published individually or linked, viewed as files by a web browser, and served in the usual way by a web server.

The key to the system is the use of relative URLs. The definitive document for this is RFC 1808. Relative URLs are resolved by the web browser in a standard way. Regardless of whether the file or http access method is used, a relative URL (one not following the file:/ or http:/ prefix with '/') is applied by starting with the current URL, stripping the current page filename, stripping a preceding directory name for each instance of '../' in the relative URL, and finally appending the relative URL (minus any '../'s).