pyxsd.xslt ========== .. py:module:: pyxsd.xslt .. autoapi-nested-parse:: XSLT 3.0 compilation, invocation, and optional advisory inspection. The normative processor, compiled stylesheet, and result views are the public entry points. :func:`inspect_stylesheet` provides a separate, non-normative binding of the packaged XSLT schemas; it never decides acceptance or compiles the stylesheet. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/pyxsd/xslt/errors/index Attributes ---------- .. autoapisummary:: pyxsd.xslt.no_args pyxsd.xslt.xs_integer_to_integer Exceptions ---------- .. autoapisummary:: pyxsd.xslt.XsltDynamicError pyxsd.xslt.XsltInspectionError pyxsd.xslt.XsltInvocationError pyxsd.xslt.ResultShapeError Classes ------- .. autoapisummary:: pyxsd.xslt.ExtensionInstruction pyxsd.xslt.ExtensionSignature pyxsd.xslt.XsltExtensions pyxsd.xslt.InspectionDiagnostic pyxsd.xslt.StylesheetInspection pyxsd.xslt.OutputPolicy pyxsd.xslt.CompiledStylesheet pyxsd.xslt.XsltProcessor pyxsd.xslt.PythonRuleContext pyxsd.xslt.PythonRules pyxsd.xslt.Message pyxsd.xslt.ResultEntry pyxsd.xslt.TransformationResult pyxsd.xslt.ExecutionLimits Functions --------- .. autoapisummary:: pyxsd.xslt.inspect_stylesheet Package Contents ---------------- .. py:exception:: XsltDynamicError(message, *, code = None, phase = 'dynamic', uri = None, module = None, package = None, location = None, stack = (), cause = None, allow_catch = True, description = None, has_description = True, value = (), line_number = None, column_number = None) A dynamic error raised while executing a transformation. ``code`` is normally an XSLT ``XTDE``/``XTTE`` code or an XPath error code. The execution runtime's own resource limits use the stable implementation code ``PYXSD-XSLT-001``; callers can test it exactly without depending on message text. ``allow_catch`` is false for foreign callback failures that crossed an XSLT boundary without being deliberately converted. .. py:attribute:: allow_catch :value: True .. py:property:: catchable :type: bool Whether a coded ``xsl:catch`` may consume this error. Only dynamically signaled XSLT/XPath errors are catchable. Static and serialization errors are outside ``xsl:try``, and a foreign callback failure is not converted merely because it crossed an XSLT boundary. .. py:exception:: XsltInspectionError Advisory stylesheet inspection could not read or bind its inputs. This is an input/resource failure, not an XSLT static error. Schema legality findings and instance binding findings are reported on :class:`~pyxsd.xslt.inspection.StylesheetInspection.report` instead. .. py:class:: ExtensionInstruction One registered application instruction and its executor. *name* is the instruction's expanded QName (``{uri}local``); *compiler* compiles the element into the application's own plan on this compilation's static context, and *executor* executes that plan through the compiled artifact's per-artifact snapshot. Both are application-supplied callables; the engine never inspects the plan type at registration time, so the executor binding is discovered when the first instruction of the family is compiled. .. py:attribute:: name :type: str .. py:attribute:: compiler :type: pyxsd.xslt.compiler.dispatch.InstructionCompiler .. py:attribute:: executor :type: pyxsd.xslt.runtime.dispatch.PlanExecutor .. py:class:: ExtensionSignature Declared parameter and result sequence types for one extension. .. py:attribute:: parameters :type: tuple[str, ...] :value: () .. py:attribute:: result :type: str :value: 'item()*' .. py:property:: parsed_parameters :type: tuple[_SequenceType, ...] .. py:property:: parsed_result :type: _SequenceType .. py:class:: XsltExtensions An immutable registry of extension functions, instructions, collations. Instruction registrations (:meth:`register_instruction`) declare trusted application extension elements the compiler recognizes before literal-result handling; each carries the application's own compiler and plan executor and is captured on the compiled artifact it was compiled with. .. py:property:: functions :type: collections.abc.Mapping[tuple[str, int], ExtensionFunction] Registered functions keyed by expanded name and arity. .. py:property:: collations :type: collections.abc.Mapping[str, Any] Registered collations keyed by absolute URI. .. py:property:: python_rules :type: pyxsd.xslt.python_rules.PythonRules The immutable Python customization rules captured at compile time. .. py:property:: instructions :type: collections.abc.Mapping[str, ExtensionInstruction] Registered instructions keyed by expanded QName. .. py:method:: with_python_rules(rules) Return a new registry carrying *rules*. .. py:method:: function(name, arity, signature = NO_ARGS) Return a registrar for one function, preserving immutability. .. py:method:: register_function(name, arity, callback, signature = NO_ARGS, *, contextual = False) Return a new registry with one Python callback registered. .. py:method:: collation(uri, *, compare = None, sort_key = None) Return a new registry with one custom collation registered. .. py:method:: register_instruction(name, *, compiler, executor) Return a new registry with one application instruction registered. *name* must be an expanded QName in the application's own namespace; the private ``urn:pyxsd:python-rules`` namespace belongs to the generated customization layer and can never be registered. The compiled artifact keeps this registration as an immutable per-compilation and per-artifact snapshot, so a later registration never changes an artifact that was compiled without it. .. py:method:: function_available(name, arity = None) Whether the registry declares *name* (an expanded or lexical QName). .. py:method:: availability() The expanded-name/arity pairs of every registered function. .. py:method:: resolve(namespaces, *, identity = None) Resolve every lexical registration against one stylesheet scope. .. py:method:: runtime_targets(context_item = None, *, existing = None, profile = None) Runtime targets keyed by expanded function name. *existing* supplies the stylesheet-function dispatchers already in the environment. A name registered both as an extension and as a stylesheet function keeps both arities: extension arities route to the Python callback and every other arity routes to the existing dispatcher. *profile* restricts callback results to the active processor's data model. .. py:data:: no_args :type: Final .. py:data:: xs_integer_to_integer :type: Final .. py:class:: InspectionDiagnostic One classified, advisory inspection finding. ``code`` is the underlying pyxsd/XSD diagnostic code. It is never a normative XSLT error code. .. py:attribute:: code :type: str .. py:attribute:: message :type: str .. py:attribute:: classification :type: DiagnosticClassification .. py:attribute:: rationale :type: str .. py:attribute:: severity :type: str :value: 'error' .. py:attribute:: phase :type: str :value: 'schema' .. py:attribute:: element :type: str | None :value: None .. py:method:: format() Render the diagnostic as one advisory line. .. py:class:: StylesheetInspection The result of advisory stylesheet inspection. ``capability`` describes the inspection profile, not stylesheet validity. A ``bound`` result carries a :class:`~pyxsd.document.Document`; an ``unsupported`` result carries no document and explains itself through ``report`` and ``diagnostics``. .. py:attribute:: capability :type: StylesheetCapability .. py:attribute:: language :type: str .. py:attribute:: document :type: pyxsd.document.Document | None .. py:attribute:: report :type: pyxsd.validation.ValidationReport .. py:attribute:: diagnostics :type: tuple[InspectionDiagnostic, ...] .. py:function:: inspect_stylesheet(source, *, language = '3.0', resource_policy = None) Bind one stylesheet module as an advisory, non-normative structural view. ``source`` is a path or readable stream. ``language`` selects the packaged XSLT 2.0 or 3.0 schema (default ``"3.0"``). A supplied ``resource_policy`` governs every read, including the packaged local schemas; a policy that denies them makes inspection fail. Resource and input failures raise :class:`XsltInspectionError`. Schema and binding findings never raise and never become normative ``XTSE*`` errors; they are reported on the returned inspection together with a classified diagnostic for each finding. .. py:class:: OutputPolicy Authorize one absolute output URI before its content is constructed. .. py:method:: authorize(uri, *, principal) Raise a resource policy error when the destination is not allowed. .. py:class:: CompiledStylesheet One immutable compiled stylesheet or package. .. py:attribute:: processor :type: XsltProcessor .. py:attribute:: package :type: pyxsd.xslt.compiler.packages.CompiledPackage .. py:attribute:: schema_pool :type: pyxsd.xdm.schema.SchemaPool | None .. py:attribute:: profile :type: pyxsd.xslt.compiler.context.ProfileOptions .. py:attribute:: static_parameters :type: collections.abc.Mapping[str, Any] .. py:attribute:: extensions :type: pyxsd.xslt.extensions.XsltExtensions .. py:attribute:: plan_executors :type: collections.abc.Mapping[type[pyxsd.xslt.compiler.plans._Plan], pyxsd.xslt.runtime.dispatch.PlanExecutor] .. py:property:: language :type: str .. py:property:: xpath :type: str .. py:property:: name :type: str | None .. py:property:: version :type: str .. py:property:: mode_names :type: tuple[str | None, ...] .. py:method:: mode_rule_count(mode = None) Number of compiled template rules in *mode*, including package layers. .. py:method:: function_available(name, arity) .. py:method:: transform(source = _ABSENT, *, parameters = None, global_context_item = _ABSENT, initial_match_selection = _ABSENT, template_parameters = None, tunnel_parameters = None, initial_template = None, initial_mode = None, initial_function = None, initial_function_arguments = (), output_uri = None, delivery = 'stylesheet', principal_serialization = None, limits = None, validation = None, validation_type = None, _budget = None, _check_principal = None) Run one fresh invocation of this compiled stylesheet. For stylesheet delivery, *principal_serialization* overrides the principal output attributes before serialization and byte accounting. Secondary results keep their own output attributes. .. py:method:: as_transform(*, target_schema, on_result = None) Expose this compiled stylesheet as a pyxsd document transform. Returns the :class:`~pyxsd.xslt.adapter.XsltDocumentTransform` adapter wired to this compiled artifact and its extension snapshot. ``Document.transform`` dispatches the adapter before the legacy root callables, so ``document.transform(sheet.as_transform(target_schema=schema))`` runs the stylesheet with explicit document delivery over the document's coherent XDM and returns a fresh document bound directly from the principal result. A compiled XSD or RELAX NG *target_schema* validates the result; pass ``None`` for a schemaless document with lexical typing and a current empty report. Secondary results and messages are ancillary output: the transform is rejected unless *on_result* receives the complete transformation result; the callback only observes. This method constructs the adapter only: conversion, validation, and result handling live in ``pyxsd.xslt.adapter``. :raises TypeError: The target is neither a compiled XSD or RELAX NG schema nor ``None``, or *on_result* is neither a callable nor ``None``. .. py:exception:: XsltInvocationError(message, *, code = None) An invalid host invocation option combination. ``code`` carries the XSLT dynamic error code when the specification gives one (for example ``XTDE0044`` for an initial mode without a match selection). The `fn:transform` adapter can reuse this validator and map the code without conflating source, global context, and selection inputs. .. py:attribute:: code :value: None .. py:class:: XsltProcessor Immutable processor identity and resource configuration. The default is an XSLT 3.0 processor with XPath 3.1 and schema awareness. ``language="2.0"`` (with the matching ``xpath="2.0"``) builds the native, schema-aware XSLT 2.0 processor: a distinct identity with its own static feature gate, XPath surface, recovery table, and serialization method selection, all owned by the profile layer. Extension registries ride on either identity; this processor rejects a profile it cannot execute instead of silently running different semantics. ``remote_resource_policy`` separately authorizes stylesheet-driven remote document reads. Its trusted implementation must constrain origins, redirects, timeouts and resource consumption. It does not authorize output writes. .. py:attribute:: language :type: str :value: '3.0' .. py:attribute:: xpath :type: str :value: '3.1' .. py:attribute:: schema_aware :type: bool :value: True .. py:attribute:: xsd_version :type: str :value: '1.1' .. py:attribute:: validation :type: str :value: 'strip' .. py:attribute:: validation_type :type: str | None :value: None .. py:attribute:: default_collation :type: str | None :value: None .. py:attribute:: implicit_timezone :type: Any :value: None .. py:attribute:: resource_policy :type: Any :value: None .. py:attribute:: remote_resource_policy :type: Any :value: None .. py:attribute:: collection_resolver :type: collections.abc.Callable[[str | None], collections.abc.Sequence[pyxsd.xdm.nodes.XdmNode]] | None :value: None .. py:attribute:: xml_policy :type: Any :value: None .. py:attribute:: xml_limits :type: Any :value: None .. py:attribute:: resolver :type: pyxsd.xslt.compiler.packages.PackageResolver | None :value: None .. py:attribute:: static_options :type: collections.abc.Mapping[str, Any] .. py:attribute:: recovery_policy :type: pyxsd.xslt.profiles.RecoveryPolicy | None :value: None .. py:attribute:: output_policy :type: pyxsd.xslt.policy.OutputPolicy | None :value: None .. py:method:: compile(source, *, static_parameters = None, schema = None, extensions = None) Compile one ordinary, simplified, or package stylesheet. Compilation completes the module/package closure and every expression, pattern, and value template this vertical slice can execute. A static failure raises :class:`~pyxsd.xslt.errors.XsltStaticError`; no partial executable artifact is returned. *extensions* is an immutable Python extension registry; the compiled artifact keeps that snapshot. .. py:class:: PythonRuleContext The restricted dynamic context passed to every Python rule callback. ``parameters`` is the current bound local frame. Delegation is legal only for the registered role; an unavailable operation raises ``XTDE0560`` and an abstract original without an implementation raises ``XTDE0040``. .. py:attribute:: context_item :type: pyxsd.xdm.XdmItem | None :value: None .. py:attribute:: parameters :type: collections.abc.Mapping[str, pyxsd.xdm.XdmSequence] .. py:method:: invoke_original(*arguments) Execute the XML component this named override replaced. .. py:method:: next_match() Continue with the next template rule in conflict-resolution order. .. py:method:: apply_imports() Continue with the next lower import-precedence template rule. .. py:class:: PythonRules An immutable set of Python component overrides and mode rules. .. py:method:: empty() :classmethod: Return an empty registry. .. py:method:: override_template(name, callback) Return a registry that replaces one named template. .. py:method:: override_function(name, arity, callback) Return a registry that replaces one stylesheet function. .. py:method:: add_mode_rule(mode, match, callback, *, priority = None) Return a registry that adds one template rule to a named mode. .. py:property:: entries :type: tuple[_PythonRule, ...] .. py:property:: bound :type: tuple[_BoundPythonRule, ...] .. py:property:: rule_count :type: int .. py:property:: original_components :type: collections.abc.Mapping[pyxsd.xslt.compiler.components.ComponentKey, pyxsd.xslt.compiler.components.Component] .. py:property:: original_plans :type: collections.abc.Mapping[pyxsd.xslt.compiler.components.ComponentKey, pyxsd.xslt.compiler.plans._ComponentPlan] .. py:method:: resolve(namespaces, *, identity = None) Resolve lexical names against one stylesheet's in-scope namespaces. .. py:class:: Message One stylesheet message or diagnostic event. ``text`` is the message's string value (what a serializer or console emits). ``content`` is the document node an ``xsl:message`` sequence constructor builds, which XSLT 3.0 section 18.1 makes the message's value: a listener or a conformance assertion inspects its nodes, not just the text. It is ``None`` only when the message constructor failed before producing content. .. py:attribute:: text :type: str .. py:attribute:: code :type: str | None :value: None .. py:attribute:: uri :type: str | None :value: None .. py:attribute:: terminate :type: bool :value: False .. py:attribute:: content :type: pyxsd.xdm.nodes.XdmDocument | None :value: None .. py:class:: ResultEntry One principal or secondary result in every available view. ``raw`` is the exact XDM sequence. ``tree`` is the delivered document when tree construction was requested and possible. ``serialized`` is the serialized string when ``delivery="stylesheet"`` produced one, while ``serialization`` records the effective output parameters. ``output_uri`` identifies the principal result or the absolute URI of a secondary result. ``character_maps`` holds the resolved ``(character, replacement)`` pairs for the effective output, so an explicit ``serialize()`` or ``write()`` reproduces the transformation's own serialization. ``effective_serialization`` records the parameters used for the delivered string, including defaults and invocation overrides, when available. .. py:attribute:: raw :type: pyxsd.xdm.values.XdmSequence .. py:attribute:: output_uri :type: str | None :value: None .. py:attribute:: tree :type: pyxsd.xdm.nodes.XdmDocument | None :value: None .. py:attribute:: serialized :type: str | None :value: None .. py:attribute:: serialization :type: collections.abc.Mapping[str, str] .. py:attribute:: character_maps :type: tuple[tuple[str, str], ...] :value: () .. py:attribute:: legacy :type: bool :value: False .. py:attribute:: messages :type: tuple[Message, ...] :value: () .. py:attribute:: effective_serialization :type: pyxsd.xslt.serialization.SerializationParameters | None :value: None .. py:property:: document :type: pyxsd.xdm.nodes.XdmDocument | None The separately delivered document, when sequence normalization built one. .. py:exception:: ResultShapeError The requested result view does not have the required shape. A raw sequence of atomics, maps, or arrays is a valid principal result but is not a document tree. Tree delivery must be requested explicitly (or by the stylesheet's output defaults); the raw sequence is never silently wrapped. .. py:class:: TransformationResult The principal and secondary results of one transformation. The result retains its invocation's output policy only so an explicit :meth:`write` can authorize the same destination again. Producing the result, :meth:`serialize`, and :meth:`principal_tree` never write. .. py:attribute:: principal_entry :type: ResultEntry .. py:attribute:: secondary :type: collections.abc.Mapping[str, ResultEntry] .. py:attribute:: messages :type: tuple[Message, ...] :value: () .. py:attribute:: warnings :type: tuple[str, ...] :value: () .. py:property:: principal :type: pyxsd.xdm.values.XdmSequence The raw principal XDM sequence, before delivery normalization. .. py:property:: principal_tree :type: pyxsd.xdm.nodes.XdmDocument The delivered principal document, or an explicitly document-shaped raw result. Raises :class:`ResultShapeError` rather than wrapping a non-document sequence or silently serializing and reparsing it. .. py:method:: to_document(schema, *, uri = None) Bind one result as a schema-bound or schemaless XML document. Omit *uri* for the principal result, or pass the exact absolute URI of a secondary result. The selected entry must have a delivered document tree or a single raw XDM document. Binding uses that tree directly and leaves all results and messages available. A RELAX NG target's captured XDM has no XSD occurrence annotations. Do not bind concurrently or reentrantly to the same schema. Pass ``None`` for a fresh schemaless document with a current empty report and lexical typing. Its untyped XDM view reflects the editable tree, which omits comments and processing instructions. :raises KeyError: The secondary URI is unknown. :raises ResultShapeError: The selected entry is not a document tree, or the tree has no document element. :raises ~pyxsd.exceptions.ValidationError: The document fails validation. The exception carries the target validation report. :raises TypeError: The schema is neither a compiled XSD or RELAX NG schema nor ``None``. .. py:method:: to_json_document(*, uri = None) Convert one raw result to an independent native JSON document. Omit *uri* for the principal result, whose source is ``""``, or select a secondary result by its exact absolute URI, which becomes the document's source. The document has a native type policy and an empty validation report. Conversion does not serialize or perform I/O and leaves all results and messages available. Empty sequences are null and singleton sequences convert directly, including map values and array members. Maps require ``xs:string`` keys, and only XDM arrays become arrays. Strings, untyped atomics, and booleans become native scalars. Integers (including derived integers) and decimals keep their exact value as ``int`` and :class:`~decimal.Decimal`; finite doubles and floats become ``float``. :raises KeyError: The secondary URI is unknown. :raises ResultShapeError: The raw result contains a multi-item sequence, a non-string map key, an XML node, a function, an unsupported atomic type, or a non-finite number. .. py:method:: serialize(uri = None, *, parameters = None) Return one result as a string, without authorization or I/O. *uri* selects the principal result when ``None`` and exactly that secondary key otherwise. *parameters* override the entry's retained effective output attributes for this call only. .. py:method:: write(destination, uri = None, *, parameters = None) Write one result after re-authorizing its absolute output URI. *uri* selects the principal result when ``None`` and exactly that secondary key otherwise. Writing is always an explicit host operation: the entry must already carry an absolute output URI, and a configured output policy authorizes this destination again with ``principal=(uri is None)``. A destination ``OSError`` becomes a ``code=None`` dynamic error retaining the original exception, except for an execution-budget alarm, which is re-raised: ``TimeoutError`` is one class, so a destination's own timeout and the caller's alarm are indistinguishable here, and the alarm is the likelier origin once a budget is set. Encoded bytes share the invocation's ``max_output_bytes`` budget with stylesheet delivery, nested transforms, and previous writes. Each write encodes again. To deliver again after exhausting the budget, run the transformation with a larger limit or with ``None``. On failure a binary destination can retain the prefix written so far; a path opened by this call is closed without removal. .. py:class:: ExecutionLimits Explicit budgets for one transformation and its nested invocations. ``max_frames`` defaults to 100,000 live explicit frames. Non-tail arithmetic recursion keeps frames for its pending work, as do supported terminal stylesheet calls in text value templates and template dispatch in literal result content. The scheduled content includes nested literals, ``xsl:sequence`` bodies, ``xsl:if`` and ``xsl:choose``, ``xsl:try`` and ``xsl:catch``, ``xsl:for-each``, ``xsl:for-each-group`` and ``xsl:iterate`` bodies, ``xsl:fork`` branches, and selected ``xsl:fallback`` bodies. Python can stop recursion first in literal construction under a live merge scope and in text value templates inside scheduled literal content. Other synchronous content includes ``xsl:value-of``, ``xsl:attribute``, ``xsl:comment``, ``xsl:processing-instruction``, ``xsl:namespace``, ``xsl:element``, ``xsl:document``, ``xsl:copy``, ``xsl:map``, ``xsl:map-entry``, ``xsl:variable``, ``xsl:param``, ``xsl:with-param`` (including in ``xsl:evaluate``), ``xsl:break``, ``xsl:next-iteration`` parameters, ``xsl:on-completion``, ``xsl:perform-sort``, ``xsl:sort`` and ``xsl:merge-key`` constructors, ``xsl:merge-action``, ``xsl:source-document``, ``xsl:result-document``, ``xsl:analyze-string`` substring bodies, ``xsl:assert``, ``xsl:message``, ``xsl:where-populated``, ``xsl:on-empty`` and ``xsl:on-non-empty``. The same limit can stop fallback XPath, such as ``($n, f($n - 1))``, a stylesheet function building nested elements (including adaptation of a deep result tree on XPath resume), or a long static XPath path. The depth depends on the interpreter and its version. Frame-budget exhaustion and ``RecursionError`` caught at scheduler guards raise an uncatchable :class:`~pyxsd.xslt.errors.XsltDynamicError` with code ``PYXSD-XSLT-001``. In CPython 3.13.8 through 3.13.12, a specialized bound method call at the recursion ceiling can raise an unrelated ``TypeError`` instead of ``RecursionError`` (CPython issue gh-145008). A safe tail call replaces its frame in place. Use ``max_steps`` to bound the number of scheduler dispatches in a tail-call chain; ``max_frames`` does not bound the length of that chain. ``max_steps`` does not interrupt work within one dispatch. ``max_documents`` bounds loaded XML documents. These and other limits described here default to ``None`` unless stated otherwise. With the default ``max_steps=None``, the processor does not stop an unbounded safe tail recursion; callers bound such a chain by setting ``max_steps``. ``max_resource_bytes`` bounds octets the transformation runtime acquires. Top-level stylesheet compilation reads and schema loads made by ``xsl:import-schema`` are outside this budget. A host ``ResourcePolicy.read()`` can allocate a whole resource before handing it over; the budget charges its returned bytes at that handoff. ``max_annotations`` defaults to 262,144 atomic type annotation entries recorded cumulatively across the transformation and its nested calls. It governs runtime tables; static XPath evaluation during stylesheet compilation precedes invocation and uses the XPath engine's own default. Each runtime table retains the values for its invocation's lifetime, so disabling the cap allows memory to grow with the number of distinct typed values bridged to or from XPath. ``max_output_nodes`` counts raw principal and secondary output nodes, their descendants and owned attributes, once by identity per result entry. Namespace nodes and implicit normalization document nodes are excluded; text nodes that normalization merges are counted separately. This bounds delivered nodes, not memory: provisional constructor and copy trees are built before their final nodes can be admitted. ``max_output_bytes`` bounds bytes encoded for stylesheet delivery and later :meth:`~pyxsd.xslt.results.TransformationResult.write` calls. Writing a result again spends the same budget. To deliver again after exhausting that budget, run the transformation with a larger limit or with ``None``. ``None`` disables any limit. Nested transforms inherit the settings unchanged and share the cumulative ledger; frames count while live. Exhaustion raises an uncatchable :class:`~pyxsd.xslt.errors.XsltDynamicError` with code ``PYXSD-XSLT-001``. .. py:attribute:: max_frames :type: int | None :value: 100000 .. py:attribute:: max_steps :type: int | None :value: None .. py:attribute:: max_documents :type: int | None :value: None .. py:attribute:: max_output_nodes :type: int | None :value: None .. py:attribute:: max_output_bytes :type: int | None :value: None .. py:attribute:: max_resource_bytes :type: int | None :value: None .. py:attribute:: max_annotations :type: int | None :value: 262144