XFA Specification
Chapter 21, XDP Specification
XDP Element Language Syntax
789
namespace it would have the unfortunate side effect of placing any packet that lacks namespace
information into the XDP namespace itself.
The following example demonstrates the proper way to declare the XDP namespace:
<xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/">
<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">
<xfa:data>
<book>
<ISBN>15536455</ISBN>
<title>Introduction to XML</title>
<author>
<firstname>Charles</firstname>
<lastname>Porter</lastname>
</author>
</book>
</xfa:data>
</xfa:datasets>
</xdp:xdp>
In the above example the namespace declaration on the
xdp
element does not impact the default
namespace and therefore the "book" fragment does not inadvertently inherit the XDP namespace.
The following example illustrates the
discouraged
practice of an XDP that expresses the XDP namespace as
the default namespace:
<!-- Declaring the XDP namespace as the default namespace is
discouraged
--!>
<xdp xmlns="http://ns.adobe.com/xdp/">
<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">
<xfa:data>
<book>
<ISBN>15536455</ISBN>
<title>Introduction to XML</title>
<author>
<firstname>Charles</firstname>
<lastname>Porter</lastname>
</author>
</book>
</xfa:data>
</xfa:datasets>
</xdp>
Important.
In the above example, the
xdp
element is not prefixed and declares its namespace via the
namespace attribute syntax of
xmlns="http://ns.adobe.com/xdp/"
. The impact of this approach is
that any descendant packet that does not declare a namespace is at risk of inheriting the XDP namespace.
Concretely, in the above example, the result is that the "book" fragment resides in the XDP namespace,
which is problematic because such an element is certainly not a valid element of the XDP format, and
downstream XML processors intending to interpret this element may no longer recognize the fragment
because it has inadvertently been namespaced.
XDP Packets
The role of an XDP packet is to encapsulate an XFA component.