Package restxsl :: Module restxmldoc :: Class RestXmlDocument
[frames | no frames]

Class RestXmlDocument

   NodeVisitor --+    
                 |    
GenericNodeVisitor --+
                     |
                    RestXmlDocument


XML version of a reStructuredText document tree. This object accepts a reStructuredText document tree and parses it into a libxml2 xmlDoc tree. The result can then be output using libxml2, fed through a libxslt stylesheet, etc.
Method Summary
  __init__(self, document, smartPunctuation)
Construct a RestXmlDocument from the given reStructuredText document tree.
  __del__(self)
  default_departure(self, node)
Override for generic, uniform traversals.
  default_visit(self, node)
Override for generic, uniform traversals.
  depart_system_message(self, node)
  depart_Text(self, node)
  depart_XmlFragment(self, node)
  depart_XpathReference(self, node)
  visit_field(self, node)
  visit_literal(self, node)
  visit_literal_block(self, node)
  visit_option_string(self, node)
  visit_raw(self, node)
  visit_system_message(self, node)
  visit_Text(self, node)
  visit_XmlFragment(self, node)
  visit_XpathReference(self, node)
    Inherited from NodeVisitor
  dispatch_departure(self, node)
Call self."depart_ + node class name" with node as parameter.
  dispatch_visit(self, node)
Call self."visit_ + node class name" with node as parameter.
  unknown_departure(self, node)
Called before exiting unknown Node types.
  unknown_visit(self, node)
Called when entering unknown Node types.

Instance Variable Summary
libxml2.xmlDoc doc: The XML document that was created when the given reStructuredText document tree was parsed.

Class Variable Summary
    Inherited from NodeVisitor
tuple optional = ()

Method Details

__init__(self, document, smartPunctuation=True)
(Constructor)

Construct a RestXmlDocument from the given reStructuredText document tree. Quotes, dashes, and ellipses in the document can optionally be transformed into their smart-and-curly Unicode counterparts.
Parameters:
document - The reStructuredText document tree; usually obtained by calling docutils.core.publish_doctree. Although this will almost always be a docutils.nodes.document object, RestXmlDocument can actually accept any docutils.nodes.Node object and will parse that into an XML tree. This might be useful if you only want to parse a specific section of the docutils document.
           (type=docutils.nodes.Node or one of its subclasses)
smartPunctuation - True to convert quotes, dashes, and ellipses to their smart (and curly) Unicode counterparts; False to leave the punctuation alone.
           (type=bool)
Overrides:
docutils.nodes.NodeVisitor.__init__

default_departure(self, node)

Override for generic, uniform traversals.

Overrides:
docutils.nodes.GenericNodeVisitor.default_departure (inherited documentation)

default_visit(self, node, isRaw=False, preserveWhitespace=False)

Override for generic, uniform traversals.

Overrides:
docutils.nodes.GenericNodeVisitor.default_visit (inherited documentation)

Instance Variable Details

doc

The XML document that was created when the given reStructuredText document tree was parsed.
Type:
libxml2.xmlDoc

Generated by Epydoc 2.1 on Wed Jul 12 11:20:42 2006 http://epydoc.sf.net