Creating Custom XPath Functions with Multiple Java Classes
You can also create custom XPath functions with multiple Java classes within a same plug-in.
Before you begin Create a custom XPath function. For more information see, see Creating Custom XPath Functions.
- Procedure
- Create different classes in the same plug-in.
-
Update the category, prefix and namespace as per requirement. For Example:
@XPathFunctionGroup(category = "Another Custom Function", prefix ="mytns2", namespace = "http://my.xpath2", helpText = "Another Custom defined function")
- Navigate to
plugin.xmland add customXpath extensions -
Update the class name and id.
-
Create OSGi component for the newly created class.
-
Create a copy of cxf.xml at the same location and provide some new name to the .xml file.
-
Update the Name, Factory ID, and Class fields on the Component pane of the Overview tab.
-
Repeat steps 5, 6, and 7 for other classes in the same plug-in.
-
Update the manifest file to include
Service-Component: OSGI-INF/cxf.xml, OSGI-INF/foo_cxf.xml, OSGI-INF/next_cxf.xml
-
Export the plug-in and install into the host repository.
-
Restart TIBCO Business Studio for BusinessWorks.
ResultThe new XPath function is available for use.
What to do nextRun the application and custom XPath functions execute from the same plug-in.