(handle-fields-wrapper2
{optional-group :optional-group default-ns :default-ns :as context})(keywordize-leading-tag v):decode/string :enter hook for the schemas produced by or->multi:
keywordizes a string leading tag so leading-tag-dispatch can dispatch on
decoded input. Descends the leading position ([0], [0 0], deeper for
nested chunks) and passes everything else through untouched.
`:decode/string` `:enter` hook for the schemas produced by `or->multi`: keywordizes a string leading tag so `leading-tag-dispatch` can dispatch on decoded input. Descends the leading position (`[0]`, `[0 0]`, deeper for nested chunks) and passes everything else through untouched.
(leading-tag-dispatch v)Dispatch fn for the schemas produced by or->multi: returns the leading XML
tag keyword of a parsed value, or nil when there is none.
Parsed values are either a flat tuple [:Tag v] or a flat chunk
[[:Tag v] ...]: sitoa's -cat-parser treats :cat/:alt children as
inline data and splices their chunks FLAT into the parent accumulator, so even
a branch whose first child is a nested :cat parses to a flat chunk whose
first element is a tagged tuple. The descent past the second level is harmless
generality. Returning nil rather than throwing lets :multi report an invalid
value for input it cannot dispatch.
Dispatch fn for the schemas produced by `or->multi`: returns the leading XML tag keyword of a parsed value, or nil when there is none. Parsed values are either a flat tuple `[:Tag v]` or a flat chunk `[[:Tag v] ...]`: sitoa's `-cat-parser` treats `:cat`/`:alt` children as inline data and splices their chunks FLAT into the parent accumulator, so even a branch whose first child is a nested `:cat` parses to a flat chunk whose first element is a tagged tuple. The descent past the second level is harmless generality. Returning nil rather than throwing lets `:multi` report an invalid value for input it cannot dispatch.
(-mtype x context)(-seq-possible? x context)(-seq-ref x context)(or->multi form)(or->multi form opts)Convert a discriminated choice form (an :or/:alt of element-tagged seqex
arms) into [:multi {:dispatch leading-tag-dispatch :decode/string {:enter keywordize-leading-tag}} ...].
Branch keys are the XML start tags of the arms, and they MUST stay that way:
sitoa's serde parser (-multi-parser) ignores :dispatch entirely and looks
the XML start-tag keyword up directly among the branch keys. The unparser and
malli coercion are the ones that use :dispatch.
Original properties and arms are preserved verbatim; a :cat arm led by an
:alt is split into one branch per member, sharing the arm's tail.
The result contains fn objects, so it is NOT EDN-serializable: this is a
load-time transform, never something to serialize, and it must be applied
AFTER any *-seq derivation (the derivation does not descend into :multi).
Throws ex-info on arms with no fixed leading tag, on duplicate branch keys
(:multi would silently keep the last), and — by default — on :alt-headed
input that would produce a :cat branch, because an :alt chunk arm is
spliced inline while a :multi consumes exactly one slot.
opts:
:decode-string? (default true) attach the :decode/string enter hook
:seqex-branches (default :throw) :allow permits :cat branches from
:alt-headed input
Convert a discriminated choice form (an `:or`/`:alt` of element-tagged seqex
arms) into `[:multi {:dispatch leading-tag-dispatch
:decode/string {:enter keywordize-leading-tag}} ...]`.
Branch keys are the XML start tags of the arms, and they MUST stay that way:
sitoa's serde parser (`-multi-parser`) ignores `:dispatch` entirely and looks
the XML start-tag keyword up directly among the branch keys. The unparser and
malli coercion are the ones that use `:dispatch`.
Original properties and arms are preserved verbatim; a `:cat` arm led by an
`:alt` is split into one branch per member, sharing the arm's tail.
The result contains fn objects, so it is NOT EDN-serializable: this is a
load-time transform, never something to serialize, and it must be applied
AFTER any `*-seq` derivation (the derivation does not descend into `:multi`).
Throws `ex-info` on arms with no fixed leading tag, on duplicate branch keys
(`:multi` would silently keep the last), and — by default — on `:alt`-headed
input that would produce a `:cat` branch, because an `:alt` chunk arm is
spliced inline while a `:multi` consumes exactly one slot.
opts:
:decode-string? (default true) attach the `:decode/string` enter hook
:seqex-branches (default :throw) `:allow` permits `:cat` branches from
`:alt`-headed input(or->multi-keys registry ks)(or->multi-keys registry ks opts)Apply or->multi to the named entries of a keyword->form registry map,
returning the updated registry. opts is passed through to or->multi.
Throws on keys absent from the registry unless {:missing :skip}.
Apply `or->multi` to the named entries of a keyword->form registry map,
returning the updated registry. `opts` is passed through to `or->multi`.
Throws on keys absent from the registry unless `{:missing :skip}`.(trim-registry-for-top-types- full-registry trimmed-registry next-keys)(xsd-builtin-decl? x default-ns)True when a declaration is a built-in XML Schema type rather than something the parsed document declares. Decided from the declaration's own name so a -seq dual is dropped or kept together with its base entry.
True when a declaration is a built-in XML Schema type rather than something the parsed document declares. Decided from the declaration's own name so a -seq dual is dropped or kept together with its base entry.
(xsd-builtin-kw? x)True for a keyword naming a built-in XML Schema type.
True for a keyword naming a built-in XML Schema type.
Local names XSOM synthesizes in the XML Schema namespace for the built-in datatype hierarchy; they come from XSOM's bundled datatypes.xsd, not from the document being parsed. The ones sitoa models are the keys of xml-primitives/xmlschema-registry; anyType and the three builtin list types are builtins too, sitoa simply has no mapping for them.
Anything else in that namespace can only come from a document that declares it - the schema for schemas (XMLSchema.xsd) declares element, complexType, particle and friends there - so it is a real declaration and must reach the registry.
Local names XSOM synthesizes in the XML Schema namespace for the built-in datatype hierarchy; they come from XSOM's bundled datatypes.xsd, not from the document being parsed. The ones sitoa models are the keys of xml-primitives/xmlschema-registry; anyType and the three builtin list types are builtins too, sitoa simply has no mapping for them. Anything else in that namespace can only come from a document that declares it - the schema for schemas (XMLSchema.xsd) declares element, complexType, particle and friends there - so it is a real declaration and must reach the registry.
Inline malli forms for built-in XML Schema types xmlschema-registry does not model. They never become registry entries, so a reference to one is inlined instead of left dangling. anyType is unconstrained content.
Inline malli forms for built-in XML Schema types xmlschema-registry does not model. They never become registry entries, so a reference to one is inlined instead of left dangling. anyType is unconstrained content.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |