On this page:
define-values/  elements-specifications
define-combined-elements-specification
10.1.4.1 Additional Helper Functions
get-attributes
get-body
0.5.91
10.1.4 Linking & Invoking🔗ℹ

 (require (submod ricoeur/tei/spec-lang private))

The (submod ricoeur/tei/spec-lang private) module provides functions for working with elements specification transformers, plus some small utilities useful when writing contracts and constructors in define-element forms.

syntax

(define-values/elements-specifications [spec ...]
  binding-clause ...)
 
binding-clause = #:tei-xexpr/c tei-xexpr/c-id
  | #:static-tei-xexpr/c static-tei-xexpr/c-id
  | #:any-tei-xexpr/c any-tei-xexpr/c-id
  | #:xexpr->tei-element xexpr->tei-element-id maybe-contract
  | #:tei-element-name/c tei-element-name/c-id
     
maybe-contract = 
  | #:define/contract
Links and invokes all of the specs, which must be elements specification transformers, binding the supplied identifiers to the resulting functions and syntactic forms.

It is a syntax error if the specs encapsulate duplicate element definitions or if any of the encapsulated definitions refer to elements that are not been defined by one of the specs.

Each binding-clause must appear exactly once, but they may be in any order. If the #:define/contract flag is present, the function bound to xexpr->tei-element-id is protected using define/contract.

For more details on the generated bindings, see tei-xexpr/c, static-tei-xexpr/c, any-tei-xexpr/c, xexpr->tei-element, and tei-element-name/c, which are implemented using define-values/elements-specifications.

syntax

(define-combined-elements-specification new-spec-id
  [spec ...+])
Binds new-spec-id as an elements specification transformer by linking together all of the specs (which must be defined as elements specification transformers).

It is a syntax error if the specs encapsulate duplicate element definitions, but missing elements are allowed at the linking stage.

10.1.4.1 Additional Helper Functions🔗ℹ

 (require (submod ricoeur/tei/kernel private))

procedure

(get-attributes xs)  (listof (list/c symbol? string?))

  xs : (and/c pair? xexpr/c)
Extracts the attributes list from xs, an x-expression representing an XML element, or '() if there are no attributes.

Note that this function does not currently enforce its contract.

procedure

(get-body xs)  (listof xexpr/c)

  xs : (and/c pair? xexpr/c)
Extracts the children of xs, an x-expression representing an XML element.

Note that this function does not currently enforce its contract.