Skip to content

API Reference parrot_formdesigner.renderers.xforms

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_formdesigner.renderers.xforms

View source

XForms 1.1 (W3C) exporter for FormSchema.

Maps a FormSchema to a W3C XForms 1.1 document using lxml. The output declares xmlns:xf="http://www.w3.org/2002/xforms" and xmlns:xs="http://www.w3.org/2001/XMLSchema". Per Q5 (resolved), V1 emits structural model + UI bindings AND <xf:bind> constraint expressions derived from FieldConstraints.

Output format: RenderedForm(content=<xml-bytes>, content_type="application/xml").

Limitations:

  • style / prefilled / errors arguments are accepted (per the base contract) but ignored; they are HTML-only concerns.
  • DependencyRule mapping covers only the simple field_id == value case; more complex AND/OR trees fall back to no relevant attribute.
  • XFormsRenderer does NOT round-trip — there is no parser back to FormSchema (Non-Goal of FEAT-152).

Alias AbstractFormRenderer

Re-exported from parrot_formdesigner.renderers.base.AbstractFormRenderer.

Alias ConditionOperator

Re-exported from parrot_formdesigner.core.constraints.ConditionOperator.

Alias DependencyRule

Re-exported from parrot_formdesigner.core.constraints.DependencyRule.

Attribute EV_NS

Alias FallbackRenderer

Re-exported from parrot_formdesigner.renderers.base.FallbackRenderer.

Alias FieldConstraints

Re-exported from parrot_formdesigner.core.constraints.FieldConstraints.

Alias FieldOption

Re-exported from parrot_formdesigner.core.options.FieldOption.

Alias FieldRenderer

Re-exported from parrot_formdesigner.renderers.base.FieldRenderer.

Alias FieldType

Re-exported from parrot_formdesigner.core.types.FieldType.

Alias FormField

Re-exported from parrot_formdesigner.core.schema.FormField.

Alias FormSchema

Re-exported from parrot_formdesigner.core.schema.FormSchema.

Alias FormSection

Re-exported from parrot_formdesigner.core.schema.FormSection.

Alias FormSubsection

Re-exported from parrot_formdesigner.core.schema.FormSubsection.

Alias LocalizedString

Re-exported from parrot_formdesigner.core.types.LocalizedString.

Attribute NSMAP

Alias RenderedForm

Re-exported from parrot_formdesigner.core.schema.RenderedForm.

Alias StyleSchema

Re-exported from parrot_formdesigner.core.style.StyleSchema.

Attribute XF_NS

Class XFormsRenderer

Render a FormSchema as an XForms 1.1 (W3C) document.

Output: RenderedForm(content=<xml-bytes>, content_type="application/xml").

The renderer ignores style / prefilled / errors parameters (HTML-only concerns) but preserves them for base-class compatibility.

Method XFormsRenderer.render

Render form as an XForms 1.1 XML document.

render(form: FormSchema, style: StyleSchema | None = None, *, locale: str = 'en', prefilled: dict[str, Any] | None = None, errors: dict[str, str] | None = None) -> RenderedForm

Parameter Type Default Description
form FormSchema The form schema.
style StyleSchema | None None Ignored (HTML concern).
locale str 'en' BCP 47 locale tag for label resolution.
prefilled dict[str, Any] | None None Ignored.
errors dict[str, str] | None None Ignored.

Returns: RenderedForm — RenderedForm carrying the XML bytes and application/xml.

Attribute XS_NS

Attribute logger

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally