Skip to content

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

  • XPath identifies the element whose complete XML is shown and replaced. This is not limited to the element's text value.
  • Size selects the editor-size option; the current form renderer uses an automatic editor height.
  • RequiredForGroup associates required validation with a validation group. PlaceHolder supplies the empty-editor prompt.
  • Hints provides guidance for the XML being edited, while Rules contains 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
<XmlTextBox XPath="Configuration" Size="Large" RequiredForGroup="">
    <PlaceHolder><![CDATA[]]></PlaceHolder>
    <Hints><![CDATA[]]></Hints>
    <Rules />
</XmlTextBox>