示例#1
0
def get_validation_schema(models, default_namespace=None):
    '''Returns the validation schema object for the given models.

    :param models: A list of rpclib.model classes that will be represented in
                   the schema.

    '''

    if default_namespace is None:
        default_namespace = models[0].get_namespace()

    fake_app = FakeApplication()
    fake_app.tns = default_namespace
    fake_app.services = []

    interface = XmlSchema()
    interface.set_app(fake_app)
    for m in models:
        interface.add(m)

    interface.build_validation_schema()

    return interface.validation_schema
示例#2
0
def get_validation_schema(models, default_namespace=None):
    '''Returns the validation schema object for the given models.

    :param models: A list of rpclib.model classes that will be represented in
                   the schema.

    '''

    if default_namespace is None:
        default_namespace = models[0].get_namespace()

    fake_app = FakeApplication()
    fake_app.tns = default_namespace
    fake_app.services = []

    interface = XmlSchema()
    interface.set_app(fake_app)
    for m in models:
        interface.add(m)

    interface.build_validation_schema()

    return interface.validation_schema
示例#3
0
文件: xml.py 项目: mardiros/rpclib
def get_schema_documents(models, default_namespace=None):
    '''Returns the schema documents in a dict whose keys are namespace prefixes
    and values are Element objects.

    :param models: A list of rpclib.model classes that will be represented in
                   the schema.

    '''

    if default_namespace is None:
        default_namespace = models[0].get_namespace()

    fake_app = FakeApplication()
    fake_app.tns = default_namespace
    fake_app.services = []

    interface = XmlSchema()
    interface.set_app(fake_app)
    for m in models:
        interface.add(m)

    interface.build_interface_document()

    return interface.get_interface_document()
示例#4
0
def get_schema_documents(models, default_namespace=None):
    '''Returns the schema documents in a dict whose keys are namespace prefixes
    and values are Element objects.

    :param models: A list of rpclib.model classes that will be represented in
                   the schema.

    '''

    if default_namespace is None:
        default_namespace = models[0].get_namespace()

    fake_app = FakeApplication()
    fake_app.tns = default_namespace
    fake_app.services = []

    interface = XmlSchema()
    interface.set_app(fake_app)
    for m in models:
        interface.add(m)

    interface.build_interface_document()

    return interface.get_interface_document()