Module n.stan

Part of nevow View Source

An s-expression-like syntax for expressing xml in pure python.

Stan tags allow you to build XML documents using Python. Stan tags have special attributes that enable the developer to insert hooks in the document for locating data and custom rendering.

Stan is a DOM, or Document Object Model, implemented using basic Python types and functions called "flatteners". A flattener is a function that knows how to turn an object of a specific type into something that is closer to an HTML string. Stan differs from the W3C DOM by not being as cumbersome and heavy weight. Since the object model is built using simple python types such as lists, strings, and dictionaries, the API is simpler and constructing a DOM less cumbersome.

Stan also makes it convenient to build trees of XML in pure python code. See nevow.stan.Tag for details, and nevow.tags for tag prototypes for all of the XHTML element types.
Line # Kind Name Docs
30 Class Proto Proto is a string subclass. Instances of Proto, which are constructed
50 Class xml XML content marker.
66 Class raw Raw content marker.
77 Function cdata CDATA section. data must be a string
83 Class directive Marker for a directive in a template
106 Class slot Marker for slot insertion in a template
168 Class Tag Tag instances represent XML tags with a tag name, attributes,
435 Class UnsetClass Undocumented
442 Function makeAccessors Undocumented
457 Function visit Invoke visitor with each Tag in the stan DOM represented by root.
473 Class NodeNotFound Undocumented
477 Class TooManyNodes Undocumented
481 Class PatternTag A pseudotag created by Tag.patternGenerator() which loops
496 Function makeForwarder Undocumented
540 Function specials Generate tags with special attributes regardless of attribute value.
553 Function specialMatches Generate special attribute matches starting with the given tag; if a tag
572 Class CommentProto Undocumented
581 Class Comment Undocumented
588 Class Entity Undocumented
598 Class inlineJS Undocumented
def cdata(data): (source)
CDATA section. data must be a string
def makeAccessors(special): (source)
Undocumented
def visit(root, visitor): (source)
Invoke visitor with each Tag in the stan DOM represented by root.
def makeForwarder(name): (source)
Undocumented
def specials(tag, special): (source)
Generate tags with special attributes regardless of attribute value.
def specialMatches(tag, special, pattern): (source)
Generate special attribute matches starting with the given tag; if a tag has special, do not look any deeper below that tag, whether it matches pattern or not. Returns an iterable.
API Documentation for Nevow, generated by pydoctor.