Soap.Schema (Soap v2.0.0)

View Source

An XML Schema model: the global declarations of one or more xsd:schema documents.

Declarations are keyed by {namespace, local_name}. read/2 reads one document and merge/2 combines documents. Importing and including other files is the loader's job.

Summary

Functions

True for a type defined by XML Schema or SOAP encoding rather than a document.

Finds a global element.

The elementFormDefault of a namespace's schema, or nil if none was read.

Combines two schemas. Declarations in later win, as xsd:redefine requires.

Reads one xsd:schema element.

The SOAP encoding namespace, which also defines types.

Finds a global type.

Every type, element, group or attribute reference with no matching declaration.

The XML Schema namespace.

Types

qname()

@type qname() :: {String.t() | nil, String.t()}

t()

@type t() :: %Soap.Schema{
  attribute_groups: %{required(qname()) => list()},
  attributes: %{required(qname()) => Soap.Schema.AttributeDecl.t()},
  element_forms: %{required(String.t() | nil) => String.t()},
  elements: %{required(qname()) => Soap.Schema.ElementDecl.t()},
  groups: %{required(qname()) => Soap.Schema.Group.t()},
  types: %{
    required(qname()) =>
      Soap.Schema.ComplexType.t() | Soap.Schema.SimpleType.t()
  }
}

Functions

builtin?(arg)

True for a type defined by XML Schema or SOAP encoding rather than a document.

element(schema, qname)

Finds a global element.

element_form(schema, namespace)

The elementFormDefault of a namespace's schema, or nil if none was read.

merge(earlier, later)

Combines two schemas. Declarations in later win, as xsd:redefine requires.

read(schema, opts \\ [])

@spec read(Soap.XML.Element.t(), keyword()) :: t()

Reads one xsd:schema element.

Options

  • :target_namespace - used when the schema declares none. A schema pulled in by xsd:include this way takes on the namespace of the schema that includes it.

soap_encoding_namespace()

The SOAP encoding namespace, which also defines types.

type(schema, qname)

Finds a global type.

unresolved_references(schema)

@spec unresolved_references(t()) :: [qname()]

Every type, element, group or attribute reference with no matching declaration.

References into XML Schema and SOAP encoding count as resolved.

xsd_namespace()

The XML Schema namespace.