4Suite API Documentation: Ft.Xml.Lib

4Suite™ API Documentation

# ► Module Ft.Xml.Lib

Module providing XML support utilities (including serialization and tree comparison)

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

Functions: BaseUri, Language

## Modules

HtmlPrettyPrinter | This module supports formatted document serialization in HTML syntax.
HtmlPrinter | This module supports document serialization in HTML syntax.
Print | This module supports document serialization in XML or HTML syntax.
StripElements |
TreeCompare | Comparison functions for XML and HTML documents (mainly used in the test suites)
XmlPrettyPrinter | This module supports formatted document serialization in XML syntax.
XmlPrinter | This module supports document serialization in XML syntax.
XmlString | Miscellaneous XML-specific string functions
cStreamWriter | Encoding character stream writer that makes substitutions of illegal and unencodable characters
routines |

## Functions

BaseUri(node, fallback=None)
  `BaseUri` is an implementation of the `node.baseURI` attribute that should be attached to DOM Level 3 nodes, but which is currently broken in 4Suite XML. Where you would use `node.baseURI` according to DOM Level 3, use `BaseUri(node)` (this function) instead.

      `BaseUri` returns the absolute base URI for a given `node` in a Domlette
      tree, or `None` if no such *absolute* base URI exists.

      If `fallback` is specified, then it is used to construct a base URI when
      everything else fails.

Language(node)
  This function returns the language property of the given instance of xml.dom.Node, based on xml:lang attributes present on the node or its ancestors. If no xml:lang attribute is present, returns None.

      The language code, if any, is returned as an uppercase string.