Chapter 4, Exchanging Data Between an External Application
and a Basic XFA Form
XFA Specification
Creating, Updating, and Unloading a Basic XFA Data DOM
124
[dataGroup (author)]
[dataValue (firstname) = "John"]
[dataValue (lastname) = "Smith"]
[dataValue (quantity) = "2"]
[dataValue (unitprice) = "30.00"]
[dataValue (discount) = ".40"]
[dataValue (notes) = "You owe $85.00, please pay up!"]
In the above example the document range is the range of document content enclosed by the
order
data
group element.
Namespaces
It is common for XML data documents to be comprised of content belonging to more than one
namespace. The formal specification of XML namespaces is provided by the "Namespaces for XML"
[XMLNAMES] specification.
Namespace inheritance is described fully in the [XMLNAMES] specification. Briefly, each element or
attribute that does not explicitly declare a namespace inherits the namespace declared by its enclosing
element. A namespace is declared using a namespace prefix. The namespace prefix must be associated
with a URI either in the element using the namespace prefix or in an enclosing element. The same rules
apply to the XFA Data DOM except for namespaces that are reserved for XFA directives, as described
below.
The following example illustrates an XML document containing information about a purchase from a
bookstore. The information is partitioned into two namespaces. The default namespace represents the
order information needed by the bookstore for inventory and shipping purposes. The other namespace
represents accounting information pertaining to the e-commerce transaction.
<?xml version="1.0" encoding="UTF-8"?>
<invoice xmlns:trn="http://www.example.com/transaction/">
<item>
<book>
<ISBN>15536455</ISBN>
<title>Introduction to XML</title>
<quantity>1</quantity>
<unitprice currency="us">25.00</unitprice>
<discount>.40</discount>
<trn:identifer>27342712</trn:identifier>
</book>
</item>
</invoice>
The use of namespaces within an XML data document assists in the determination of data values and data
groups, and can also exclude document content from data loader processing. The by default handling of
namespaces is described in this section, and additional control over namespace processing is described in
the section
“The excludeNS Element” on page 370.
The document range always excludes any document content as follows:
●
●
●
content belonging to the namespace "
http://www.xfa.com/schema/xfa-package/
"
content belonging to the namespace "
http://www.xfa.org/schema/xfa-package/
"
content belonging to the namespace
"http://www.w3.org/2001/XMLSchema-instance",
including
nil
attributes
attributes with a namespace prefix of
xml
, such as
"xml:space"
and
"xml:lang"
●