XML Text Box¶
XmlTextBox is a code-editor widget for the complete XML at its bound node. It displays formatted outer XML rather than only the node's text content.
Validation and Save Behavior¶
On a valid edit, the widget replaces the node's outer XML. An empty edit produces an empty element with the current node name. If parsing fails, the widget leaves the model unchanged, marks the editor border red, and reports an invalid-XML error in the form UI.
Replacing outer XML can change the element name, attributes, and children beneath the bound node. Restrict access to this widget to trusted technical users and validate the resulting form schema in the process that consumes it.
XML Fields¶
XPathidentifies the element whose complete XML is shown and replaced. This is not limited to the element's text value.Sizeselects the editor-size option; the current form renderer uses an automatic editor height.RequiredForGroupassociates required validation with a validation group.PlaceHoldersupplies the empty-editor prompt.Hintsprovides guidance for the XML being edited, whileRulescontains any form rules that apply to the widget.
The value is written only after it parses as XML. Keeping XPath narrow limits the part of the data model that a technical editor can replace.
Example¶
1 2 3 4 5 | |