Chapter 5, Representing and Processing Rich Text
XFA Specification
Representation of Rich Text Across XML and XFA DOMs
187
Rich Text That Inserts External Objects
Another use for the rich text idiom is run-time insertion of data into a larger body of text. This can be done
even with text that is nominally boilerplate, such as the content of a
draw
element. The embedded data is
the content of some object accessible via an XFA-SOM expression. Most commonly it is the content of a
field, but it is not restricted to fields.
If the embedded object contains rich text then the content of the object may be incorporated as rich text.
However it may optionally be reduced to plain text before incorporation.
The embedded object may contain an image. In this case the image flows with the surrounding larger
body of text as though it was a single character. This is discussed in more detail in
“Text” on page 54.
For more information about this use of the rich text idiom, see
“Rich Text That Contains External Objects”
on page 191.
Version Identifiers for Rich Text Producers and Rich Text Specifications
Rich text may be produced by a variety of sources and may include a range of XHTML and CSS features, not
all of which are supported in XFA.
XFA grammar adds version numbers as optional attributes in the rich text HTML
body
element. These
attributes identify the version of the application producing the rich text (
xfa:APIVersion
) and identify
the version of the rich text spec to which the rich text complies (
xfa:spec
). These attributes are
described in
“Version Specification” on page 951.
Representation of Rich Text Across XML and XFA DOMs
Recognizing Rich Text
One set of rules is used to recognize rich text in the template and another set is used to recognize rich text
in data. The rules for recognizing rich text in data is more relaxed, reflecting the varied origins of data. Rich
text data appears within some element named according to the user's own schema, whereas in the
template it is within an element defined by an XFA schema.
Recognizing Data as Rich Text
For data to be recognized as rich text, at least one of the following criteria must be met:
Content type.
The enclosing element bears a
contentType
attribute in the namespace
http://www.xfa.org/schema/xfa-data/1.0/
with the value of
text/html
.
Note:
Do not use
text/xhtml
as the value for
contentType
; it is
not
recognized.
Namespace.
The element content belongs to the XHTML 1.0 namespace
Recognizing Rich Text Introduced in the Template
For template text values to be recognized as rich text,
all
of the following criteria must be met:
Contained in
exData
with
contentType="text/html"
. (The default value for
contentType
is
"
text/plain
".
Includes the XHTML namespace
Rich text contained in <
body
> or <
span
> element
Home Index Bookmark Pages
Pages: Home Index All Pages