When creating a DOM from an XML source, XML parsers are required to consider several conditions when deciding whether to include whitespace-only text nodes. This function ignores all of those conditions and removes all whitespace-only text descendants of the specified node. If the unlink flag is specified, the removed text nodes ...
RPy is a very simple, yet robust, Python interface to the R Programming Language. It can manage all kinds of R objects and can execute arbitrary R functions (including the graphic functions). All errors from the R language are converted to Python exceptions. Any module installed for the R system can ...
ShearerSite is a static templating system and web-based site manager. It installs easily and works with existing web sites and editing tools, since all pages stay as pure HTML. Content plugins render navigation, RSS newsfeeds, weblogs, and more. ...
This script shows: how to derive a class from NullWriter that accumulates text from the body of an HTML page, how to derive a class from HTMLParser that retains metatag information, how to instantiate these classes and display a typical result of using them. ...
This script presents a way of serializing & de-serializing XML using the marshal module. The XML is converted to an equivalent Python dictionary first, which is marshaled to serialize it. De-serialization first unmarshals the dictionary from the file, and constructs the original XML. ...
This script is a small implementation of a stopwatch widget in Tkinter. The widget displays a label with minutes:seconds:1/100-seconds. The label is updated every 50 ms, but that can easily be changed. Methods are availble for starting, stopping and resetting the stopwatch. ...
This module provides a function to summarize a XHTML string - that is, shorten it so it is has no more than a given amount of words while keeping XHTML (or, hopefully, any XML) tags intact. ...
This script adds support for the "in" operator to the attributes map of minidom elements. When you parse XML using minidom, you can get a map of attributes for any element. The problem is that using the "in" operator on this map will raise an exception and this script will fix ...
This script simply takes a single-dimension sequence and converts into into an HTML unordered list. This function makes it simple to present the contents of a sequence on the web in an neat fashion. ...
MSHTML is the COM component used by Internet Explorer to parse HTML pages (since version 4 of IE). This script shows you how to use this component independently of IE. ...
This code shows how to use the relatively unknown LexicalHandler interface, which is an extension to the standard SAX2 interfaces like ContentHandler. ...
PyXML is a useful package for parsing XML. The xmlval and xmldtd modules let you validate XML docs against an external DTD file. This is a simple, straightforward script that illustrates how to use the xmlval and xmldtd modules for validated XML parsing. ...
Sometimes you want to work more with the form of an XML document than with the structural information it contains. For instance if you wanted to change a bunch of entity references or element names. Also, sometimes you have slightly incorrect XML that a traditional parser will choke on. In that ...
Sometimes one needs a quick and dirty solution for parsing and generating xml. This script uses only the python parser itself for the parsing of xml. xml code is translated to valid python code and then evaluated. The generated objects can then be manipluated within python itself and treated as regular python ...
This script reads an xml file into a python dictionary of dictionaries (repeated elements are read in as lists). It works with repeating elements without having to specify the multiple attribute. ...
Yaptoo is an enhanced version of yaptu, another templating utility.Features: - separated parsing from execution - added caching of parsed templates - added some error reporting - added a choice of template syntaxes - added comment syntax - added Cheetah-style variable substitution with optional caching of ...
In this script two classes are provided, HTML_Table and HTML_Month. HTML_Table can manage the generation of a table in HTML format. HTML_Month builds on top of HTML_Table and expands on its capabilities. It allows to create dynamically tables that have the look of the selected month. Requirements: · z_matrix ...