Chapter 4, Exchanging Data Between an External Application
and a Basic XFA Form
XFA Specification
Creating, Updating, and Unloading a Basic XFA Data DOM
135
However, the data value element
ISBN
contains additional leading and trailing space around the text
"15536455"
; this white space is considered significant. In addition, the data value element
title
contains leading and trailing newlines and white space; this white space is also considered significant.
The data loader produces the same result from the above example as from the following:
<book><ISBN> 15536455 </ISBN><title>
Introduction to XML
</title></book>
Rich Text
Some content may represent
rich text,
which is text with markup representing formatting information such
as underlining. A subset of HTML and CSS markup is supported in XFA, as described in
“Rich Text
Reference” on page 934.
The markup within rich text data is not represented by nodes in the XFA Data DOM. Rather, it is stripped of
markup and represented in the XFA Data DOM as plain text, as described in the chapter
“Representing and
Processing Rich Text” on page 186.
Image Data
XML data documents may include image data, either in-line or by reference. To be recognized as enclosing
image data an element must have a
contentType
attribute in the XFA data namespace
(
http://www.xfa.org/schema/xfa-data/1.0/
). The value of this attribute must be a MIME-type
identifying an image type. During loading the XFA processor copies this value into the contentType
property of the corresponding dataValue node in the XFA Data DOM. However, after inspecting the image
data, the XFA processor may decide that the image is in a different format and update the value of the
property in the XFA Data DOM. Any such inspection, if and when it is done, is done on a best-effort basis.
In addition, if the image is included in-line, there may be a
transferEncoding
attribute, also in the XFA
data namespace. The value of this attribute indicates the manner in which the image data is encoded.
There are two supported values for
xfa:transferEncoding
.
An
xfa:transferEncoding
value of
base64
means the data is encoded using the base 64 method
described in
[RFC2045].
This encoding method packs only six data bits into each character, but the
resulting character are all legal element content. This is the default encoding method assumed when there
is no
xfa:transferEncoding
attribute. For example, the following example contains image data:
<logo xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"
xfa:contentType="image/bmp">
Qk1uAQAAAAAAAD4AAAAoAAAAJgAAACYAAAABAAEAAAAAADABAADYDgAA2A4AAAIAAAAAAAAAAAAA
AP///wD//////AAAAP/////8AAAA//////wAAAD//////AAAAP/////8AAAA//////wAAAD8AAAA
/AAAAP38AH78AAAA/fAAHvwAAAD9wAAG/AAAAP2AAAb8AAAA/QAAAvwAAAD9AAAC/AAAAPwAAAD8
AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwA
AAD8AAAA/AAAAPwAAAD8AAAA/AAAAPwAAAD9AAAC/AAAAP0AAAL8AAAA/YAABvwAAAD9wAAG/AAA
AP3gAA78AAAA/fAAHvwAAAD9/AB+/AAAAPwAAAD8AAAA//////wAAAD//////AAAAP/////8AAAA
//////wAAAD//////AAAAP/////8AAAA
</logo>
In the above example the image data has been formatted by inserting line breaks and white space. This is
acceptable because base 64 decoders are required to ignore line breaks and white space.
An
xfa:transferEncoding
value of
cdata
means the image data encoded according to the rules for
XML, with each byte of data represented by a character or a single-character XML entity. For example,