Copyright 2005 Fourthought, Inc. (USA). Detailed license and copyright information: http://4suite.org/COPYRIGHT Project home, documentation, distributions: http://4suite.org/
Classes:
|
Globals:
|
It is designed to be overridden as applications need different functionality from sources.
source = InputSource(...) stream - the stream associated with this input source uri - the absolute URI of the input source processIncludes - Whether or not XIncludes should be expanded stripElements - Space stripping rules factory - The factory that created this instance resolver - URI resolver; defaults to Ft.Lib.Uri.BASIC_RESOLVER catalog - TR9401/XML Catalog object for resolving public IDs encoding - a string externally declaring the stream's encoding
If your derived InputSource requires additional state information then you have to override how it is cloned and pickled.
This function is used when a URI reference is encountered in the original stream and needs to be resolved (e.g. xi:include, xsl:include, xsl:import, document(), etc.). When a catalog is available, its URI entries are used first. If no entry is found, the URI is resolved against the current URI and then opened. The hint parameter is used to give a hint as to what the resolution will be used for. If the ignoreErrors flag is set, an error during resolution (such as "file not found") will result in None's being returned, rather than a raised exception.
Presented with an optional public identifier and a system identifier, this function attempts to locate a mapping in the catalog, if one is defined. If no mapping is found, the system identifier will be dereferenced as a URL.
uri - a URI from which the input will be read. Important: a file path is generally not a URI. To be safe, if you wish to read from a file, use the following pattern: from Ft.Lib import Uri uri = Uri.OsPathToUri("/path/to/file.ext") OR uri = Uri.OsPathToUri("C:\path\to\file.ext")