The DECLARE statement defines constants that act as aliases for the complete namespace names.
You can declare constants within schemas, modules, routines, or compound statements (both implicit and explicit). The behavior of these cases is as follows:
A constant or variable declared within a routine overlays any parameters of the same name, and all constants and variables of the same name declared in a containing module or schema.
Within any one schema or module, all constants occupy a namespace. A constant declared within a module overlays any constant of the same name and type declared in the containing schema.
Constants within the DECLARE statement are always referred to by a single unqualified identifier.
At the schema level the DECLARE statement supports only the declaration of constants.
This function also creates a one-to-one mapping between namespace constants and namespaces. This enables features such as content-assist (list all the valid symbols that you can enter at this point) and impact-analysis (list every reference to this element) to be incorporated.
An error is reported if the use of a SpaceId, which is not equal to the name of a namespace constant, is found. This applies only to explicit references to elements by name.
This example illustrates a namespace declaration, its use as a SpaceId in a path, and its use as a character constant in a namespace expression:
DECLARE prefixOne NAMESPACE 'http://www.example.com/PO1'; -- On the right hand side of the assignment a namespace constant is being used as such while, -- on the left hand side, one is being used as an ordinary constant (that is, in an expression). SET OutputRoot.XML.{prefixOne}:{'PurchaseOrder'} = InputRoot.XML.prefixOne:PurchaseOrder;
Notices |
Trademarks |
Downloads |
Library |
Support |
Feedback
![]() ![]() |
ak04980_ |