Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(2)  |  Derive(0)  |  Import(1)

        def validateString(aString, firstOccurrenceOnly=0, fallback=None, base=""):
  loggedEvents = []
  if type(aString) != unicode:
    encoding, aString = xmlEncoding.decode("", None, aString, loggedEvents, fallback)
  else:
    encoding = "utf-8" # setting a sane (?) default

  if aString is not None:
    validator = _validate(aString, firstOccurrenceOnly, loggedEvents, base, encoding)
    return {"feedType":validator.feedType, "loggedEvents":validator.loggedEvents}
  else:
    return {"loggedEvents": loggedEvents}
        


src/f/e/feedvalidator-HEAD/src/validtest.py   feedvalidator(Download)
  """
  func = lambda self, xmlfile=xmlfile, exc=exc, params=params: \
       method(self, exc, params, feedvalidator.validateString(open(xmlfile).read(), fallback='US-ASCII', base=xmlBase)['loggedEvents'])
  func.__doc__ = description
  return func

src/i/n/interssection-HEAD/tests/validator.py   interssection(Download)
from xml.parsers.expat import ExpatError, ParserCreate
 
from feedvalidator import validateString
from feedvalidator.logging import Error
 
    check_xml_wellformedness(string)
 
    for event in validateString(string)['loggedEvents']:
        if isinstance(event, Error):
            raise ValidationError(event)