4Suite™ API Documentation

# ► Module Ft.Xml.Xslt.StylesheetReader

Classes for the creation of a stylesheet object

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

Classes: StylesheetReader |  |  |  | Globals: STYLESHEET_WHITESPACE_RULES, XMLNS_NAMESPACE, XSL_NAMESPACE, property_dom_node

## Classes

class StylesheetReader(Ft.Xml.Xslt.StylesheetHandler.StylesheetHandler)
  This class can be used to read, from a variety of sources, a stylesheet and all its included and imported stylesheets, building from them a single, compact representation of an XSLT stylesheet tree (an Ft.Xml.Xslt.Stylesheet.Stylesheet object).

      This is done with the most efficient parsing method available, and
      avoids creating a Domlette document for each document it reads.

  ### Methods

  __init__(self, altBaseUris=None, ownerDocument=None, importIndex=0, globalVars=None, extElements=None, visitedStyUris=None)
    Overrides: __init__ from class StylesheetHandler
  clone(self)
    Overrides: clone from class StylesheetHandler
  fromDocument(self, document, baseUri='', factory=None)
    Read in a stylesheet source document from a Domlette and add it to the stylesheet tree. If a document with the same URI has already been read, the cached version will be used instead (so duplicate imports, includes, or stylesheet appends do not result in multiple reads).
  fromInstant(self, instant, baseUri='', is_import=0)
    Read in an "instant" stylesheet (a pickled stylesheet tree) and add it to the stylesheet tree.
  fromSrc(self, isrc, extElements=None)
    Read in a stylesheet source document from an InputSource and add it to the stylesheet tree. If a document with the same URI has already been read, the cached version will be used instead (so duplicate imports, includes, or stylesheet appends do not result in multiple reads).
  reset(self)
    Overrides: reset from class StylesheetHandler

  ### Methods inherited from class Ft.Xml.Xslt.StylesheetHandler.StylesheetHandler

  addExtensionElementMapping, characters, endDocument, endElementNS, getResult, setDocumentLocator, startDocument, startElementNS, startPrefixMapping

## Globals

STYLESHEET_WHITESPACE_RULES = [(u'http://www.w3.org/1999/XSL/Transform', 'text', False), (None, '*', True)]
XMLNS_NAMESPACE = u'http://www.w3.org/2000/xmlns/'
XSL_NAMESPACE = u'http://www.w3.org/1999/XSL/Transform'
property_dom_node = 'http://xml.org/sax/properties/dom-node'