dvm:lookup-dvm
Syntax
dvm:lookup-dvm (mapName, referenceElementName, referenceValue, elementName, defaultValue, needAnException)
Description
The dvm:lookup-dvm function finds the reference element value in a domain value map and returns the equivalent value of the specified element name as a string. This form of DVM lookup is used to find a single reference element and return a single element value. Lookups involving multiple elements in a reference or return domain need to be done using the dvm:lookupValueNVP function. This function is identical in purpose and function to the dvm:lookupValue function. It exists to mimic the function names defined in the ESB implementation of DVM.
Parameters
| Parameter | Description |
|---|---|
|
mapName |
The domain value map name, as string. |
|
referenceElementName |
The name of the source element in the DVM, as string. |
|
referenceValue |
The source value (an XPath expression bound to the source document of the XSLT transformation), as string. |
|
elementName |
The name of the target element in the DVM, as string. |
|
defaultValue |
A default value to assign to the target element if no value is found, as string. |
|
needAnException |
Specify true or false. If the needAnException parameter is set to true, an exception occurs if the value being looked up in the map is not found. If the needAnException parameter is set to false, an empty value is returned if the value being looked up in the map is not found. |
Returns
This function returns a string by looking up the value for the target element in the DVM, where the value for the source element is equal to the source value. The source value is an XPath expression bound to the source document of the XSLT transformation. The expression is evaluated during the transformation and the result value is passed as the source value for lookup.
An exception can occur for the following reasons:
-
The DVM map with a given name is not found.
-
The specified elements are not found.
-
The specified source value is empty.
Example
The following code looks up the value of the Short element in the StateCodes DVM map corresponding to the Calif value in the Abbrev element:
dvm:lookup-dvm("StateCodes","Abbrev","Calif","Short","CouldNotBeFound", True)