2005-03-18 23:47:16

Comparison functions for XML and HTML documents (mainly used in the test suites)

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

An HTML parser that meets our needs better than Python's htmllib.HTMLParser, and that works with Python 2.1.

Used by CompareHTML().

7
2
4
6
3
1

A cmp()-like function that compares two HTML strings by parsing with sgmllib.SGMLParser and comparing events until a mismatch is found. It has the side effect of reporting differences to stdout.

ignoreWhitespace controls whether whitespace differences in text events are ignored.

Compare two HTML strings. The result is similar to the builtin cmp() function such that non-zero indicates non equal and zero means equal.

Equivalent to calling TreeCompare() with ignoreWhitespace=1.

A function that compares two XML DOM nodes by traversing their attributes and descendants recursively until a mismatch is found. It has the side effect of reporting differences to stdout. Returns true if the nodes compare equal.

ignoreWhitespace controls whether whitespace differences in text nodes are ignored.

ignoreComments controls whether comment nodes are ignored.

ignoreNsDecls controls whether namespace declarations are ignored.

A cmp()-like function that compares two XML or HTML strings and has the side effect of reporting differences to stdout. Returns false if the nodes compare equal.

XML strings are parsed into a Domlette and compared node-by-node. HTML strings are parsed with an SGML parser and are compared event-by-event. The markup type is guessed based on clues in the expected string.

ignoreWhitespace controls whether whitespace differences in text nodes are ignored.

'file:' URIs based on the current working directory are generated for each document. The baseUri argument is an optional absolute URI to use as the basis of the generated URIs, if a 'file' URI is undesirable.

readExtDtd controls whether the external DTD subset is read when parsing XML. It does not affect the reading of external entities declared in the internal DTD subset.

ignoreNsDecls controls whether namespace declarations are ignored when comparing XML documents.

<Ft.Lib.Uri.FtUriResolver instance>
['img', 'area', 'basefont', 'frame', 'isindex', 'meta', 'param', 'hr', 'base', 'link', 'br', 'input', 'col']
True
u'http://www.w3.org/2000/xmlns/'

Compiled regular expression objects

<_sre.SRE_Pattern object>

Compiled regular expression objects

<_sre.SRE_Pattern object>

Compiled regular expression objects

<_sre.SRE_Pattern object>

Compiled regular expression objects

<_sre.SRE_Pattern object>