2005-04-12 06:32:17

Things commonly needed by many modules in Ft.Xml

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

Classes and functions that help implement OASIS XML and TR9401 Catalogs. Resolution with Catalogs is handled via the Ft.Xml.InputSource module.

Based on a contribution to PyXML from Tarn Weisner Burton <twburton@users.sf.net>. See http://sourceforge.net/tracker/index.php?func=detail&aid=490069&group_id=6473&atid=306473

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

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/

Classes providing a standard interface and encapsulation of metadata for document/entity streams intended for input to various XML processors.

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

Functions, classes, modules that support Ft.Xml (4XML, Domlette, etc.)

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

General-purpose utility class for generating XML (may eventually be expanded to produce more output types)

Sample usage:

from Ft.Xml import MarkupWriter writer = MarkupWriter(indent=u"yes") writer.startDocument() writer.startElement(u'xsa') writer.startElement(u'vendor') #Element with simple text (#PCDATA) content writer.simpleElement(u'name', content=u'Centigrade systems') #Note writer.text(content) still works writer.simpleElement(u'email', content=u"info@centigrade.bogus") writer.endElement(u'vendor') #Element with an attribute writer.startElement(u'product', attributes={u'id': u"100\u00B0"}) #Note writer.attribute(name, value, namespace=None) still works writer.simpleElement(u'name', content=u"100\u00B0 Server") #XML fragment writer.xmlFragment('<version>1.0</version><last-release>20030401</last-release>') #Empty element writer.simpleElement(u'changes') writer.endElement(u'product') writer.endElement(u'xsa') writer.endDocument()

Note on the difference between 4Suite writers and printers Writer - module that exposes a broad public API for building output bit by bit Printer - module that simply takes a DOM and creates output from it as a whole, within one API invokation

Localizable message strings

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

Abstraction module for Domlette SAX usage.

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

XInclude processing

XInclude processing is normally controlled via the Domlette reader APIs and is implemented within Domlette itself. This module just provides constants and classes to support XInclude processing.

XInclude is defined at http://www.w3.org/TR/xinclude

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

XLink processing package

See http://www.w3.org/TR/xlink/

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

4XPath initialization and principal functions

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

Module for XPointer processing

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

XUpdate request processing

XUpdate is specified (poorly) at http://xmldb-org.sourceforge.net/xupdate/xupdate-wd.html

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

4XSLT initialization and XSLT pattern tools

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

XVIF integration for 4Suite. Includes basic RELAX NG support

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

4XML command-line application

cDomlette implementation: a very fast 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/

cDomlette implementation: a very fast DOM-like library tailored for use in XPath/XSLT

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

General-purpose utility class for generating XML (may eventually be expanded to produce more output types)

Sample usage:

from Ft.Xml import MarkupWriter writer = MarkupWriter(indent=u"yes") writer.startDocument() writer.startElement(u'xsa') writer.startElement(u'vendor') #Element with simple text (#PCDATA) content writer.simpleElement(u'name', content=u'Centigrade systems') #Note writer.text(content) still works writer.simpleElement(u'email', content=u"info@centigrade.bogus") writer.endElement(u'vendor') #Element with an attribute writer.startElement(u'product', attributes={u'id': u"100\u00B0"}) #Note writer.attribute(name, value, namespace=None) still works writer.simpleElement(u'name', content=u"100\u00B0 Server") #XML fragment writer.xmlFragment('<version>1.0</version><last-release>20030401</last-release>') #Empty element writer.simpleElement(u'changes') writer.endElement(u'product') writer.endElement(u'xsa') writer.endDocument()

Note on the difference between 4Suite writers and printers Writer - module that exposes a broad public API for building output bit by bit Printer - module that simply takes a DOM and creates output from it as a whole, within one API invokation

Convenience factory function for Markup writers (based on xsl:output in XSLT)

Create a simple tag with optional attributes and content. The complete element, start tag, optional text content, end tag, will all be generated by this one call. Must *not* be matched with an endElement call

tagName - qualified name of the element (must be unicode) namespace - optional namespace URI attribute - optional dictionary mapping name to unicode value the name can either be a unicode QName or a tuple of (QName, namespace URI) content - optional unicode object with the text body of the simple element

Create a start tag with optional attributes. Must eventually be matched with an endElement call

tagName - qualified name of the element (must be unicode) namespace - optional namespace URI attribute - optional dictionary mapping name to unicode value the name can either be a unicode QName or a tuple of (QName, namespace URI)

Incorporate a well-formed general entity into the output. fragment of fragment - string (must not be a Unicode object) to be incorporated verbatim into the output, after testing for wellp-formedness

dictionary for instance variables (if defined)

<attribute '__dict__' of 'MarkupWriter' objects>

list of weak references to the object (if defined)

<attribute '__weakref__' of 'MarkupWriter' objects>

Exception class for errors specific to XML reading (at a level above standard, non-namespace-aware parsing)

201
101
202
200
100

Exception class for errors specific to XInclude processing

11
10

#Wrap this so that we can import it later

#Good ol' backward compatibility for creative spellings

PyXML is required by some features of 4Suite (e.g., validating parsing, and 4XSLT's SaxWriter). This is a common function to test whether a correct version of PyXML is installed. It raises a SystemExit if the test result is negative, and returns None otherwise.

The feature argument is a string indicating which feature in 4Suite requires PyXML. It is output as part of the SystemExit message.

SplitQName(qualifiedName) -> (prefix, localName)

where 'qualifiedName' is a QName according to XML Namespaces 1.0 <http://www.w3.org/TR/REC-xml-names>. returns the name parts according to the spec.
qualifiedName
None
None
True
True
u'http://www.w3.org/1999/xhtml'
u'http://www.w3.org/2000/xmlns/'
u'http://www.w3.org/XML/1998/namespace'
['EMPTY_NAMESPACE', 'EMPTY_PREFIX', 'XML_NAMESPACE', 'XMLNS_NAMESPACE', 'XHTML_NAMESPACE', 'READ_EXTERNAL_DTD', 'HAS_PYEXPAT', 'ReaderException', 'XIncludeException', 'SplitQName', 'ApplyXUpdate', 'MarkupWriter']
'1.0b1'
StrictVersion ('0.8')