Progress
External Program
Interfaces


Namespace Processing

Namespace processing is enabled by default.

To disable it, set SUPPRESS-NAMESPACE-PROCESSING to TRUE.

XML Namespace processing is potentially complex. But here is a summary of the behavior to expect from a Progress SAX application.

Namespace Declarations

An XML document that uses namespaces has one or more Namespace declarations, which appear as attributes of elements. A namespace declaration might appear as an attribute of any element; frequently the document element (the one that encloses all of the other elements) has the namespace declaration or declarations.

A namespace declaration associates a prefix with a URI. Once associated, the prefix might appear with element names, attributes names, or both, to distinguish the names from identical names that might mean something else. For example, an XML element whose name is “memory” might mean completely different things, and have different valid attributes, depending on whether it appears in a computer inventory or in a psychological report. You can distinguish the uses by having a computer-inventory namespace and a psychological-report namespace.

In the SAX2 interface, XML Namespaces affect the values of the parameters of StartElement and EndElement, and the attribute data in the attributes parameter of StartElement. There can be slight variations in the way that Progress SAX handles namespace processing.

Namespace Processing’s Effects

In Progress SAX, Namespace processing affects the behavior of:

Table 12–5 describes the effect of Namespace processing on StartElement and EndElement.

Table 12–5: Effect Of Namespace Processing On StartElement and EndElement
If Namespace Processing Is
Enabled...
If Namespace Processing Is Suppressed...
If an element’s name has a namespace prefix:
  • namespaceURI will be the URI associated with the prefix
  • localName will be the name as given in the XML doc, without the prefix
  • qName will be the name as given in the XML doc
If an element’s name has no prefix:
  • namespace URI will be empty
  • localName will be the name as given in the XML document
  • qName will be the name as given in the XML document
If there is a default Namespace in effect and an element name has no prefix:
  • namespaceURI will be the URI of the default Namespace
  • localName will be the name as given in the XML doc
  • qName will be the name as given in the XML doc (there is no prefix, since the default Namespace doesn’t specify a prefix)
Whether or not an element’s name has a namespace prefix:
  • namespaceURI will be empty
  • localName will be empty
  • qName will be the name as given in the XML document (including the prefix, if there is one)

Table 12–6 describes the effect of Namespace processing on Attributes data.

Table 12–6: Effect Of Namespace Processing On Attributes Data
If Namespace Processing Is
Enabled...
If Namespace Processing Is Suppressed...
The behavior is the same as that for Element names, except that a default Namespace does not apply to attribute names, so an attribute with no prefix will never have a value for its namespaceURI.
Whether or not an attribute’s name has a namespace prefix:
  • namespaceURI will be empty
  • localName will be empty
  • qName will be the name as given in the XML document (including any prefix)

For more information on Namespace processing, see the reference entry for the SUPPRESS-NAMESPACE-PROCESSING attribute in the Progress Version 9 Product Update Bulletin .


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095