Example XPath Expression for Counting the Number of Child Nodes of a Complex Interface Variable

Count the number of child nodes of a complex interface variable child node using the text-based XPath Editor.


  1. Right-click on the Business Process canvas to activate the Tool Palette.
  2. Select the Activities tool palette and drag and drop the Assign activity onto the design canvas.
  3. Select the Assign activity on the canvas.
  4. Define the source and target values for the assignment.
  5. Define the XPath expression:
    1. Open the Properties section and select the Assign tab to display the text-based XPath Editor for the source and target values.
    2. In the Source XPath edit box, position the cursor where you want to insert functions or operators.
    3. Right-click in the expression, and select Node Set Functions > count.
    4. Edit the function to remove the error marker that appears to the left of the expression.
    5. Do the same for the Target XPath expression.
  6. Save the business process service definition.
Related tasks
Editing Variables in an XPath Expression
Saving a Code Snippet
Reusing a Code Snippet

Send your feedback on this help topic to Sybase Technical Publications: pubs@sybase.com

Your comments will be sent to the technical publications staff at Sybase, Inc. For product-related issues or technical support, contact Sybase Technical Support at 1-800-8SYBASE.