Creating Custom Xpath Functions
This topic provides the detailed procedure of creating a custom Xpath function group. You can use the Custom Xpath Function wizard to create your custom Xpath function group. It uses the com.tibco.xml.cxf.customXPathFunction extension.
- Procedure
- OpenTIBCO Business Studio for BusinessWorks and select .
- In the
New Project window, select
Plug-in Project and click
Next.
- Specify a name for the project that reflects the Xpath functions, for example,
MyCustomXPathFunctions. Retain all other default selections and click
Next.
-
On the Plug-in Content page, locate the Options group and select This plug-in will make contributions to the UI.
- Accept all the defaults and click Next.
- Select Custom Xpath Function Wizard on the
Templates page, and click
Next.
-
In the New Custom Xpath function group plug-in project window, provide values for the following fields and click Next to continue.
.
• Category: The name of the category that includes the custom Xpath functions • Prefix: The prefix for the functions • Namespace: The namespace for the functions • Help Text: The description of the functions -
Specify the XPath Function and XPath Function Parameters in the XPath Function Group Creation Section dialog.
- Click the
Add button on the right side of the
XPath Functions table and provide values for:
Name: the name of the functionReturn Type: the return type of the functionDescription: the description of the functionBW XML Types: Select one of the XML types, such as item, node, item-set, node-set, and atom.
- Click the
Add button on the right side of the
XPath Function Parameters table. Specify values for the following parameters and click
Finish:
Name: the name of the parameterType: the data type of the parameterOptional: select the checkbox if the parameter is optional.BW XML Types: Select one of the XML types as item, node, item-set, node-set, atom, Focus, DynamicContext, and TypedContext.Is Hidden: The checkbox is auto-selected for Focus, DynamicContext, and TypedContext types, all of which are BW XML Types. If unchecked (not hidden) for these types, the installed CXF does not show under the Functions tab.
- Select the Use Logger checkbox to create the default logger object when creating the custom Xpath functions.
- The
Open Associated Perspective dialog displays. Click
Yes.
TIBCO Business Studio for BusinessWorksopens in the Plug-in and the Plug-in Development perspective.
- Open the Java class in the newly created Custom Xpath function plug-in and implement the Custom Xpath function.
Now your Custom Xpath function is ready for use at design time and run time.Note: The Custom Xpath functions work only when the plug-in is marked as singleton.