In the cases where your document needs a correct base URI, use this form
of import:
from Ft.Xml.Domlette import NonvalidatingReader
In case you're wondering, there is also a ValidatingReader that uses the document's <!DOCTYPE> declaration to find its schema,
and validates the document against the schema. We'll
assume that validation is taken care of elsewhere.
Then, to turn that document into a DOM tree, use one of these methods:
NonvalidatingReader.parseURI ( uri )
Read the document from a given URI. The
argument specifies the document's location as well
as its base URI.
uri
NonvalidatingReader.parseStream ( f, uri
)
Read the document from a readable file object . The f argument
must be the document's base URI.
uri
NonvalidatingReader.parseString ( s, uri
)
The
argument is a string containing the entire
document. The s argument must be the
document's base URI.
uri
Each of these reader functions returns a Document instance.