Native XFA exData XML

The general event host creates absent exData value properties and imports real foreign XML children into their native form occurrences; XHTML draw content reaches the rich text PDF consumer after native XDP persistence and reload

Importing and reading XML

const content = row.label.value.exData;
content.contentType = "text/html";
content.loadXML(
  '<body xmlns="http://www.w3.org/1999/xhtml">' +
  '<p><span style="font-size:18pt;color:#0000FF">Changed</span></p>' +
  '</body>',
  false,
  true
);
const currentXML = content.saveXML();
const readableXML = content.saveXML("pretty");

loadXML(source, ignoreRoot=true, overwrite=false) accepts a well-formed XML document string and returns undefined; ignoreRoot appends the aggregating root's children, while false appends the root itself

Overwrite replaces existing content before import; its default false appends content in document order, preserving previously imported children

saveXML() returns the current exData element and its content as a UTF-8 XML declaration and fragment string; the optional literal pretty indents element-only content while preserving mixed text and CDATA whitespace

Imported element names, namespace declarations, namespace-qualified attributes, literal Unicode, character references, mixed text and CDATA remain native XML; markup is not stored as a plain rawValue string

Creation and defaults

Value properties permit one exData child, mutually exclusive with the other value choices; a missing draw value and exData child can be created and imported during the same event

exData defaults to maxLength=-1 and transferEncoding=none, with empty contentType, href, id, name, rid, use and usehref attributes

The event host does not expose a scalar value accessor on exData; use loadXML and saveXML for foreign XML content

Immediate reads, identity and transactions

A pure native XML operation validates and serializes each request before script execution continues; malformed XML throws inside the script and can be handled by try/catch without changing the current content

The deterministic response replay shares the existing script transaction and executes no UI, file, network or transport side effects

Subsequent saveXML calls see earlier successful imports and current exData attributes during the same event; retained references resolve the current node identity in later events

Only the targeted repeated occurrence receives native content, and a new occurrence initializes from template XML rather than copying an existing occurrence's imported override

An empty imported root with overwrite=true clears the actual content and remains empty after persistence and reload; it does not revert to template content

Unhandled script errors and native publication failures restore exact native XDP bytes, including earlier ordinary field writes and XML mutations

Budgets and saved consumption

Script limits bound XML input and output bytes, native element and text nodes, depth, operations, elapsed time and replay responses; widget MaxValueChars also bounds the published XML value

The FPC bridge preserves UTF-8 bytes through XML responses and ordinary action values, including accented characters and supplementary Unicode

Saved XHTML draw content uses the existing rich text consumer's font, size, color and inline CSS behavior; independent PDF readers verify first-instance text, replacement styling, new-instance content and explicit clearing

Remaining XML integration targets

This delivery implements exData content operations; other nodeclass loadXML/saveXML methods, Data DOM structural import and general foreign-node mutation remain separate targets

DTD declarations and custom entity catalogs remain unimplemented; predefined entities and decimal or hexadecimal character references are supported

In-element comments and processing instructions remain native through import, immediate reads, save, reload and rollback; document-level markup outside the root and complete XML lexical round trips remain separate targets

External href resolution, encoded exData transfers, maxLength enforcement, foreign media consumers and Unicode rich widget appearances remain separate implementation targets

References and related APIs

Import root and replacement semantics follow the Adobe XFA Element API; XML names, references and whitespace follow XML 1.0

See TXFAEventBinding, TXFAEventActionKind, Rich Text Properties and Interactive XFA Runtime