Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/sissaschool/xmlschema
/ functions
Functions
2,466 in github.com/sissaschool/xmlschema
⨍
Functions
2,466
◇
Types & classes
351
↳
Endpoints
20
↓ 367 callers
Method
is_valid
Like :meth:`validate` except it does not raise an exception on validation error but returns ``True`` if the XML data object is valid,
xmlschema/dataobjects.py:271
↓ 271 callers
Method
parse_error
Helper method for registering parse errors. Does nothing if validation mode is 'skip'. Il validation mode is 'lax' collects the error
xmlschema/validators/xsdbase.py:183
↓ 260 callers
Method
decode
Decode the XML document to a nested Python dictionary. :param kwargs: options for the decode/to_dict method of the schema instance.
xmlschema/documents.py:617
↓ 221 callers
Method
casepath
(cls, relative_path)
tests/test_converters.py:61
↓ 148 callers
Method
encode
Encodes the data object to XML. :param validation: the validation mode. Can be 'lax', 'strict' or 'skip. :param kwargs: opti
xmlschema/dataobjects.py:308
↓ 136 callers
Method
check_schema
Create a schema for a test case. :param source: A relative path or a root Element or a portion of schema for a template. :pa
xmlschema/testing/_test_case_classes.py:155
↓ 120 callers
Method
check_encode
(self, xsd_component, data, expected, **kwargs)
tests/validation/test_encoding.py:39
↓ 105 callers
Method
update
(self, other: 'StagedMap[CT]')
xmlschema/validators/builders.py:413
↓ 98 callers
Method
get
(self, name)
xmlschema/extras/wsdl.py:84
↓ 98 callers
Method
validate
(cls, instance: Any)
xmlschema/arguments.py:459
↓ 96 callers
Method
validation_error
Helper method for collecting or raising validation errors. :param validation: :param validator: the XSD validator related wi
xmlschema/validators/validation.py:238
↓ 95 callers
Function
etree_elements_assert_equal
Tests the equality of two XML Element trees. :param elem: the master Element tree, reference for namespace mapping. :param other: the ot
xmlschema/testing/_helpers.py:38
↓ 92 callers
Function
normalize_url
Returns a normalized URL eventually joining it to a base URL if it's a relative path. Path names are converted to 'file' scheme URLs and unsa
xmlschema/utils/urls.py:205
↓ 80 callers
Method
parse
Set and parse the component Element.
xmlschema/validators/xsdbase.py:383
↓ 71 callers
Function
etree_tostring
Serialize an Element tree to a string. :param elem: the Element instance. :param namespaces: is an optional mapping from namespace prefi
xmlschema/utils/etree.py:203
↓ 70 callers
Method
check_advance_true
Advances a model with a match condition and checks the expected error list or exception. :param model: an ModelGroupVisitor instance
tests/validators/test_models.py:62
↓ 65 callers
Method
copy
(self)
xmlschema/validators/builders.py:679
↓ 60 callers
Method
check_advance_false
Advances a model with a no-match condition and checks the expected error list or exception. :param model: an ModelGroupVisit
tests/validators/test_models.py:75
↓ 59 callers
Method
get_facet
(self, tag: str)
xmlschema/validators/simple_types.py:599
↓ 54 callers
Method
as_uri
(self)
xmlschema/utils/paths.py:119
↓ 48 callers
Method
get_schema
Returns a new schema instance from schema settings. Optional keyword arguments must be options for schema initialization and can be p
xmlschema/settings.py:322
↓ 45 callers
Method
get
Gets a data element attribute.
xmlschema/dataobjects.py:148
↓ 43 callers
Method
iter
Creates an iterator for the data element and its subelements. If tag is not `None` or '*', only data elements whose matches tag are r
xmlschema/dataobjects.py:206
↓ 43 callers
Method
parse_error
(self, message)
xmlschema/extras/wsdl.py:576
↓ 42 callers
Method
parse_error
(self, error: Union[str, Exception], elem: Optional[ElementType] = None,
xmlschema/validators/attributes.py:624
↓ 41 callers
Method
getroot
Get the root element of the XML document.
xmlschema/documents.py:597
↓ 40 callers
Function
is_etree_element
A validator for ElementTree elements that excludes XsdElement objects.
xmlschema/utils/etree.py:22
↓ 40 callers
Function
run_xmlschema_tests
(target=None, args=None)
xmlschema/testing/_factory.py:104
↓ 39 callers
Method
replace
Creates a new converter instance from the existing, replacing options provided with keyword arguments.
xmlschema/converters/base.py:203
↓ 36 callers
Function
get_namespace
Returns the namespace URI associated with a QName in extended form or a local name. If the argument is not conformant to QName format returns
xmlschema/utils/qnames.py:20
↓ 35 callers
Method
unmap_qname
(self, qname: str, name_table: Container[str | None] | None = None, xm
xmlschema/converters/gdata.py:56
↓ 34 callers
Method
advance
Generator function for advance to the next element. Yields tuples with particles information when occurrence violation is found.
xmlschema/validators/models.py:267
↓ 34 callers
Method
has_occurs_restriction
( self, other: Union[ModelParticleType, ParticleMixin, 'OccursCalculator'])
xmlschema/validators/groups.py:280
↓ 34 callers
Method
read
(self, n: int = ...)
xmlschema/utils/protocols.py:20
↓ 33 callers
Method
get_nsmap
Returns the namespace map (nsmap) of the element. Returns `None` if no nsmap is found for the element. Lazy resources have only the n
xmlschema/resources/xml_loader.py:175
↓ 33 callers
Function
get_prefixed_qname
Get the prefixed form of a QName, using a namespace map. :param qname: an extended QName or a local name or a prefixed QName. :param nam
xmlschema/utils/qnames.py:96
↓ 33 callers
Method
open
Returns an opened resource reader object for the instance URL. If the source attribute is a seekable file-like object rewind the sour
xmlschema/resources/xml_resource.py:431
↓ 32 callers
Method
set_xmlns_context
Set the right context for the XML data and its level, updating the namespace map if necessary. Returns the xmlns declarations of the
xmlschema/namespaces.py:185
↓ 32 callers
Method
to_json
Converts loaded XML data to a JSON string or file. :param fp: can be a :meth:`write()` supporting file-like object. :param j
xmlschema/documents.py:631
↓ 31 callers
Method
clear
(self)
xmlschema/validators/builders.py:409
↓ 31 callers
Function
split_path
Splits a path expression to a sequence of chunks that put in evidence path steps, predicates and other parts that can be useful for checking
xmlschema/xpath/selectors.py:42
↓ 30 callers
Function
local_name
Return the local part of an expanded QName or a prefixed name. If the name is `None` or empty returns the *name* argument. :param qname:
xmlschema/utils/qnames.py:74
↓ 29 callers
Method
build
(self)
xmlschema/validators/groups.py:631
↓ 28 callers
Method
check_complex_restriction
(self, base, restriction, expected=None, **kwargs)
tests/validators/test_complex_types.py:25
↓ 28 callers
Function
get_context
Get the XML document validation/decode context. :return: an XMLResource instance and a schema instance.
xmlschema/documents.py:46
↓ 28 callers
Method
write
Serialize an XML resource to a file. Cannot be used with lazy resources.
xmlschema/documents.py:675
↓ 27 callers
Method
clear
(self)
tests/validators/test_groups.py:39
↓ 27 callers
Function
is_unc_path
Returns `True` if the provided path is a UNC path, `False` otherwise. Based on the capabilities of `PureWindowsPath` of the Python release.
xmlschema/utils/paths.py:24
↓ 26 callers
Method
_parse_child_component
(self, elem: ElementType, strict: bool = True)
xmlschema/validators/xsdbase.py:443
↓ 26 callers
Function
count_digits
Counts the digits of a number. :param number: an int or a float or a Decimal or a string representing a number. :return: a couple with t
xmlschema/utils/decoding.py:32
↓ 25 callers
Method
check_decode
(self, xsd_component, data, expected, **kwargs)
tests/validation/test_decoding.py:558
↓ 25 callers
Method
decode
Decodes XML data. Takes the same arguments of the method :meth:`iter_decode`.
xmlschema/validators/schemas.py:1615
↓ 25 callers
Method
is_empty
Returns `True` if the instance has an empty content, `False` otherwise.
xmlschema/validators/xsdbase.py:795
↓ 25 callers
Method
resolve_qname
QName resolution for a schema instance. :param qname: a string in xs:QName format. :param namespace_imported: if this argume
xmlschema/validators/schemas.py:1160
↓ 24 callers
Method
is_lazy
Returns `True` if the XML resource is lazy.
xmlschema/resources/xml_resource.py:252
↓ 23 callers
Method
find
Finds the first data element matching the path. :param path: an XPath expression that considers the data element as the root.
xmlschema/dataobjects.py:382
↓ 23 callers
Function
get_qname
Returns an expanded QName from URI and local part. If any argument has boolean value `False` or if the name is already an expanded QName, ret
xmlschema/utils/qnames.py:53
↓ 23 callers
Method
is_restriction
(self)
xmlschema/validators/xsdbase.py:840
↓ 23 callers
Method
iter
XML resource tree iterator. If tag is not None or '*', only elements whose tag equals tag are returned from the iterator. In a lazy r
xmlschema/resources/xml_resource.py:536
↓ 23 callers
Method
iterfind
Creates and iterator for all XSD subelements matching the path. :param path: an XPath expression that considers the XSD component as
xmlschema/xpath/mixin.py:125
↓ 22 callers
Method
check_url
(self, url, expected)
tests/test_locations.py:120
↓ 22 callers
Method
findall
Finds all data elements matching the path. :param path: an XPath expression that considers the data element as the root. :pa
xmlschema/dataobjects.py:396
↓ 22 callers
Method
load
Loads the XML text from the data source. If the data source is an Element the source XML text can't be retrieved.
xmlschema/resources/xml_resource.py:512
↓ 22 callers
Method
map_qname
Converts an extended QName to the prefixed format. Only registered namespaces are mapped. :param qname: a QName in extended
xmlschema/namespaces.py:265
↓ 21 callers
Method
is_derived
Returns `True` if the instance is derived from *other*, `False` otherwise. The optional argument derivation can be a string containin
xmlschema/validators/xsdbase.py:829
↓ 21 callers
Function
is_local_url
(obj: object)
xmlschema/utils/urls.py:98
↓ 21 callers
Method
iter_model
A generator function iterating elements and groups of a model group. Skips pointless groups, iterating deeper through them. R
xmlschema/validators/groups.py:324
↓ 21 callers
Function
raw_encode_value
Encodes a simple value to XML.
xmlschema/utils/decoding.py:72
↓ 21 callers
Function
update_namespaces
Update a namespace map without overwriting existing declarations. If a duplicate prefix is encountered in a xmlns declaration, and this i
xmlschema/utils/qnames.py:157
↓ 20 callers
Method
is_matching
(self, name: Optional[str], default_namespace: Optional[str] = None)
xmlschema/xpath/mixin.py:90
↓ 19 callers
Method
check_decode_encode
(self, root, converter=None, etree_element_class=None, **kwargs)
xmlschema/testing/_builders.py:283
↓ 19 callers
Method
check_validity
(self, xsd_component, data, expected, use_defaults=True)
tests/validation/test_validation.py:176
↓ 19 callers
Method
create_empty_content_group
Creates an empty local child content group for a complex type or a group.
xmlschema/validators/builders.py:235
↓ 19 callers
Function
is_drive_path
Returns `True` if the provided path starts with a drive (e.g. 'C:'), `False` otherwise.
xmlschema/utils/paths.py:32
↓ 19 callers
Function
iter_collapsed_content
Iterates a content stored in a sequence of couples *(name, value)*, yielding items in the same order of the sequence, except for repetitions
xmlschema/validators/models.py:890
↓ 18 callers
Function
etree_getpath
Returns the XPath path from *root* to descendant *elem* element. :param elem: the descendant element. :param root: the root element.
xmlschema/utils/etree.py:75
↓ 18 callers
Method
from_uri
Parse a URI and return a LocationPath. For non-local schemes like 'http', 'https', etc. a LocationPosixPath is returned. For Windows
xmlschema/utils/paths.py:60
↓ 18 callers
Function
is_remote_url
(obj: object)
xmlschema/utils/urls.py:80
↓ 18 callers
Method
match
(self, name: Optional[str], default_namespace: Optional[str] = None, **kwargs: Any)
xmlschema/validators/elements.py:1098
↓ 18 callers
Method
render
(self, names, parent=None, global_vars=None)
xmlschema/extras/codegen.py:215
↓ 17 callers
Method
check_json_serialization
(self, root, converter=None, etree_element_class=None, **kwargs)
xmlschema/testing/_builders.py:374
↓ 17 callers
Method
get_element
(self, tag: str, path: Optional[str] = None, namespaces: Optional[NsmapType] = None)
xmlschema/validators/schemas.py:946
↓ 17 callers
Method
get_namespaces
(self, namespaces: Optional[NsmapType] = None, root_only: bool = True, root_default: bo
xmlschema/documents.py:591
↓ 17 callers
Method
get_xmlns
Returns the list of namespaces declarations (xmlns and xmlns:<prefix> attributes) of the element. Returns `None` if the element doesn
xmlschema/resources/xml_loader.py:185
↓ 17 callers
Method
is_matching
(self, name: Optional[str], default_namespace: Optional[str] = None, group: Optional['XsdG
xmlschema/validators/elements.py:1084
↓ 17 callers
Method
iter_errors
Generates a sequence of validation errors if the XML data object is invalid. Accepts the same arguments of :meth:`validate`.
xmlschema/dataobjects.py:284
↓ 17 callers
Method
overall_max_occurs
Returns the overall maximum for occurrences of a content model particle.
xmlschema/validators/xsdbase.py:893
↓ 17 callers
Method
overall_max_occurs
Returns the overall max occurs of a particle in the model subtracting the occurrences already registered by the occurs counter. Defau
xmlschema/validators/models.py:570
↓ 17 callers
Method
overall_min_occurs
Returns the overall minimum for occurrences of a content model particle.
xmlschema/validators/xsdbase.py:885
↓ 17 callers
Method
overall_min_occurs
Returns the overall min occurs of a particle in the model subtracting the occurrences already registered by the occurs counter. Defau
xmlschema/validators/models.py:548
↓ 17 callers
Method
unmap_qname
Converts a QName in prefixed format or a local name to the extended QName format. Local names are converted only if a default namespa
xmlschema/namespaces.py:292
↓ 16 callers
Function
get_extended_qname
Get the extended form of a QName, using a namespace map. Local names are mapped to the default namespace. :param qname: a prefixed QName
xmlschema/utils/qnames.py:124
↓ 16 callers
Method
is_over
Tests if particle occurrences are equal or over the maximum. If the argument is `None` then tests the current element.
xmlschema/validators/models.py:622
↓ 15 callers
Method
export
Exports a schema instance. The schema instance is exported to a directory with also the hierarchy of imported/included schemas.
xmlschema/validators/schemas.py:1056
↓ 15 callers
Method
get_namespaces
Extracts namespaces with related prefixes from the XML resource. If a duplicate prefix is encountered in a xmlns declaration, and
xmlschema/resources/xml_resource.py:743
↓ 15 callers
Method
invalid_type_error
(self, error: Union[TypeError, AttributeError], value: Any)
xmlschema/validators/facets.py:91
↓ 15 callers
Method
is_emptiable
Returns `True` if the instance has an emptiable value or content, `False` otherwise.
xmlschema/validators/xsdbase.py:799
↓ 15 callers
Method
map_type
Maps an XSD type to a type declaration of the target language. This method is registered as filter with a name dependant from
xmlschema/extras/codegen.py:269
↓ 15 callers
Method
normalize
Normalize and restrict value-space with pre-lexical and lexical facets. :param text: text string encoded value. :return: a n
xmlschema/validators/simple_types.py:447
↓ 15 callers
Function
sort_content
(content: EncodedContentType, group: ModelGroupType)
xmlschema/validators/models.py:885
next →
1–100 of 2,466, ranked by callers