2005-11-15 04:36:08

Abstraction module for Domlette usage. Domlette is a DOM-like library tailored for use in XPath/XSLT.

Copyright 2005 Fourthought, Inc. (USA). Detailed license and copyright information: http://4suite.org/COPYRIGHT Project home, documentation, distributions: http://4suite.org/

Defined to support the old interfaces. If you're still using this, please upgrade to the newer API.

Creates a default InputSource from a python file-like object (the stream argument). The document URI should be provided as the refUri argument. This will be used in the resolution of system IDs in the DTD and document type declaration, and will be embedded in the Domlette nodes for use by the application, such as for resolution of relative URI references in XSLT's document(), xsl:import, and xsl:include, among others.

Creates a default InputSource from an ordinary python byte string (the st argument). The document URI should be provided as the refUri argument. This will be used in the resolution of system IDs in the DTD and document type declaration, and will be embedded in the Domlette nodes for use by the application, such as for resolution of relative URI references in XSLT's document(), xsl:import, and xsl:include, among others.

Creates a default InputSource from a URI (the uri argument). The baseUri and ownerDoc arguments are ignored.

Base class to be used by all readers which can accept well-formed EPEs. Non-validating only. Allows an InputSource factory to be specified. Allows control over whether the external DTD subset is read.

Base class to be used by all non-validating readers that do not need to read the external DTD subset. Allows an InputSource factory to be specified.

Base class to be used by all non-validating readers. Allows an InputSource factory to be specified. Allows control over whether the external DTD subset is read.

Wrapper for a Saxlette parser that allows you to walk a Domlette tree and fire off SAX2 events as if parsing an XML source.

node - the Domlette node to be walked baseUri - optional override for the baseUri to use in parsing by default this is retrieved from the Domlette node

Execute the SAX2 parse phase (using Saxlette)

Base class to be used by all validating readers. Allows an InputSource factory to be specified.

Base class for all XML readers. Subclassed by NonvalidatingReaderBase and ValidatingReaderBase.

Reads XML from an Ft.Xml.Inputsource.InputSource, and returns a Domlette document node.

Reads an XML document entity from a python file-like object (the stream argument), and returns a Domlette document node.

The document URI should be provided as the uri argument. This will be used in the resolution of system IDs in the DTD and document type declaration, and will be embedded in the Domlette nodes for use by the application, such as for resolution of relative URI references in XSLT's document(), xsl:import, and xsl:include, among others.

Reads an XML document entity provided as an ordinary python byte string (the st argument), and returns a Domlette document node. st cannot be a Unicode string.

The document URI should be provided as the uri argument. This will be used in the resolution of system IDs in the DTD and document type declaration, and will be embedded in the Domlette nodes for use by the application, such as for resolution of relative URI references in XSLT's document(), xsl:import, and xsl:include, among others.

Reads an XML document entity from a URI (the uri argument), and returns a Domlette document node.

Since foreign DOMs are not supported within 4Suite, this function lets users create a Domlette DOM from whatever DOM they are using.

If the documentURI is not specified, it will try and get it from the document using DOM L3 attributes documentURI, then baseURI. If no URI is found, a warning is issued and a urn:uuid is generated for it.

GetAllNs(node) -> dict

Get all of the namespaces defined in scope of this node.
node

NonvalParse(isrc[, readExtDtd]) -> Document

isrc[, readExtDtd]

Given a Node instance assumed to be the root of a DOM or Domlette tree, this function serializes the document to the given stream or stdout, using the given encoding (UTF-8 is the default). Extra whitespace is added to the output for visual formatting. The asHtml flag can be used to force HTML-style serialization of an XML DOM. Otherwise, the DOM type (HTML or XML) is automatically determined. This function does nothing if root is not a Node.

It is preferable that users import this from Ft.Xml.Domlette rather than directly from Ft.Xml.Lib.Print.

Given a Node instance assumed to be the root of a DOM or Domlette tree, this function serializes the document to the given stream or stdout, using the given encoding (UTF-8 is the default). The asHtml flag can be used to force HTML-style serialization of an XML DOM. Otherwise, the DOM type (HTML or XML) is automatically determined. This function does nothing if root is not a Node.

It is preferable that users import this from Ft.Xml.Domlette rather than directly from Ft.Xml.Lib.Print.

SeekNss(node) -> dict

Traverses the tree to seek an approximate set of defined namespaces.
node

ValParse(isrc) -> Document

isrc

Non-validating reader instance that accepts well-formed XML External Parsed Entities, created from EntityReader() with no constructor arguments.

Uses the default InputSource factory. If you need to change it, reassign the inputSourceFactory attribute, or, preferably, just create a new EntityReader instance.
<Ft.Xml.Domlette.EntityReaderBase instance>

The default non-validating, external DTD subset-ignoring reader instance, created from NoExtDtdReaderBase() with no constructor arguments.

Uses the default InputSource factory. If you need to change it, reassign the inputSourceFactory attribute, or, preferably, just create a new NoExtDtdReaderBase instance.
<Ft.Xml.Domlette.NoExtDtdReaderBase instance>

The default non-validating reader instance, created from NonvalidatingReaderBase() with no constructor arguments.

Uses the default InputSource factory. If you need to change it, reassign the inputSourceFactory attribute, or, preferably, just create a new NonvalidatingReaderBase instance.
<Ft.Xml.Domlette.NonvalidatingReaderBase instance>
True

The default validating reader instance, created from ValidatingReaderBase() with no constructor arguments.

Uses the default InputSource factory. If you need to change it, reassign the inputSourceFactory attribute, or, preferably, just create a new ValidatingReaderBase instance.
<Ft.Xml.Domlette.ValidatingReaderBase instance>
['implementation', 'NonvalParse', 'ValParse', 'Print', 'PrettyPrint', 'GetAllNs', 'SeekNss', 'ConvertDocument', 'ValidatingReaderBase', 'NonvalidatingReaderBase', 'NoExtDtdReaderBase', 'EntityReaderBase', 'ValidatingReader', 'NonvalidatingReader', 'NoExtDtdReader', 'EntityReader']

The DOMImplementation interface provides a number of methods for performing operations that are independent of any particular instance of the document object model.

<DOMImplementation>