4Suite API Documentation

Module amara.scimitar

Python compiler from ISO Schematron to a Python validator script
Classes:
Functions:
Globals:

Classes

class Usage(Exception)

Methods

__init__(self, msg)
Overrides: __init__ from class Exception

Methods inherited from class Exception

__new__

Methods inherited from class BaseException

__delattr__, __getattribute__, __getitem__, __reduce__, __repr__, __setattr__, __setstate__, __str__, __unicode__

Methods inherited from class object

__hash__, __reduce_ex__

Members

__weakref__ = <attribute '__weakref__' of 'Usage' objects>

Members inherited from class BaseException

__dict__, args, message

Members inherited from class object

__class__
class pattern

Methods

__init__(self, name, id_, abstract)
class stron_consumer
Encapsulation of a set of semi-co-routines designed to handle SAX Events from Schematron

Methods

__init__(self, output)
handle_assert(self, end_condition)
handle_diagnostic(self, end_condition)
handle_extends(self, end_condition)
handle_key(self, end_condition)
handle_ns(self, end_condition)
handle_obsolete_schema(self, end_condition)
handle_pattern(self, end_condition)
handle_phase(self, end_condition)
handle_report(self, end_condition)
handle_rule(self, end_condition)
handle_rule_let(self, end_condition)
handle_schema(self, end_condition)
handle_title(self, end_condition)
xml_repeater(self, indent)

Functions

command_line_prep()
main(argv=None)
run(stron_src, validator_outf, legacy_ns=False, prep_for_test=0)

Globals

ABSPAT_DELIMITER = u'\x01'
ASSERT_SKEL = u' expr = CompileXPath(%(test)s)\n if not Conversions.BooleanValue(expr.evaluate(xpath_ctx)):\n'
DIAG_SKEL = u'def diag%(diagcount)i(xpath_ctx):\n #Diagnostic named %(id)s\n'
EMIT_ATTRIBUTE_SKEL = u'%(indent)sWRITER.attribute(%(qname)s, %(ns)s, %(val)s)\n'
EMIT_DIAG_ID_ITEM = u' %(id)s: %(func)s,\n'
EMIT_END_ELEM_SKEL = u'%(indent)sWRITER.endElement(%(qname)s, %(ns)s)\n'
EMIT_NAME_SKEL = u'%(indent)sexpr = CompileXPath(%(path)s)\n%(indent...evaluate(xpath_ctx))\n%(indent)sWRITER.text(name)\n'
EMIT_PHASE_ITEM = u' %(id)s: %(patterns)s,\n'
EMIT_RULE_PATTERN_ITEM = u' XPATTERN_PARSER.parse(%(pat)s): %(func)s,\n'
EMIT_START_ELEM_SKEL = u'%(indent)sWRITER.startElement(%(qname)s, %(ns)s)\n'
EMIT_TEXT_SKEL = u'%(indent)sWRITER.text(%(text)s)\n'
EMIT_VALUE_OF_SKEL = u'%(indent)sexpr = CompileXPath(%(select)s)\n%(inde....evaluate(xpath_ctx))\n%(indent)sWRITER.text(val)\n'
ISO_STRON_NS = 'http://purl.oclc.org/dsdl/schematron'
MAIN_SKEL = u'\n#Set up the function library for context object... print >>sys.stderr, err.msg\n return 2\n\n'
OLD_STRON_NS = 'http://www.ascc.net/xml/schematron'
QB_SKEL = u''
REPORT_SKEL = u' expr = CompileXPath(%(test)s)\n if Conversions.BooleanValue(expr.evaluate(xpath_ctx)):\n'
RULE_SKEL = u'\ndef %(rname)s(node):\n #For context XPattern ...nstruction()\n xpath_ctx.functions = FUNCTIONS\n'
SCRIPT_HEADER = u'#!/usr/bin/env python'
SCRIPT_SKEL = u'\nif __name__ == "__main__":\n sys.exit(main(sys.argv))\n\n'
TEST_SCRIPT_SKEL = u'\nif __name__ == "__main__":\n if not TEST:\n sys.exit(main(sys.argv))\n\n'
TOP_SKEL = u"#!/usr/bin/env python\n#Warning: this is an auto-...tp://4suite.org/amara/scimitar/schematron-file'\n\n"
XSL_NAMESPACE = u'http://www.w3.org/1999/XSL/Transform'