Rich text objects

An element declaration that defines content from an XHTML schema will be mapped to a rich Text Field object rather that a plain Text Field object. That is, the <field> object that is created in the form design will have <value><exData contentType="text/html"/></value>.

Three situations arise in which an element will be identified as having rich text content:

  • The schema imports the XHTML schema and declares an element containing a single child, which is the xhtml <body> element, as shown in the following example:

        <xsd:schema xmlns:xsd="http://www.w3.ord/2001/XMLSchema" 
                xmlns:xhtml="http://www.w3.ord/1999/xhtml"> 
        <xsd:import namespace="http://www.w3.org/1999/xhtml"/> 
        <xsd:element name="RichTextField"> 
            <xsd:complexType> 
                <xsd:sequence> 
                    <xsd:element ref="xhtml:body"/> 
                </xsd:sequence> 
            </xsd:complexType> 
        </xsd:element>
  • A schema document declares a string type element with a default or fixed value that begins with the following content:

    <body xmlns="http://www.w3.org/1999/xhtml" ...

In this case, a rich text object is created with the value set to that of the default or fixed value.

  • An element declaration includes an attribute of xfa:contentType with a fixed value of text/html, as shown in the following example:

        <xsd:schema xmlns:xsd="http://www.w3.ord/2001/XMLSchema" 
                        xmlns:xfa="http://www.adobe.com/2003/xfa"> 
        <xsd:import namespace="http://www.adobe.com/2003/xfa"/> 
        <xsd:element name="RichTextField"> 
            <xsd:complexType> 
                <xsd:simpleContent> 
                    <xsd:extension base="xsd:string"> 
                        <xsd:attribute ref="xfa:contentType" fixed="text/html"/> 
                    </xsd:extension> 
                </xsd:simpleContent> 
            </xsd:complexType> 
        </xsd:element>

    In this example, the xfa:contentType attribute will not be used to generate a field as in the general attribute case. Instead, it will be interpreted as a directive that the field generated should be a Rich Text Field. In terms of the namespace identifier, the form design has xmlns="http://www.xfa.org/schema/xfa-template/2.1/ and the XDP file has xmlns:xdp="http://ns.adobe.com/xdp/.

// Ethnio survey code removed