Example: Using the XPathXmlStreamReader Component

XPathXmlStreamReader parses a single row of data from a single XML input file and sends the row to the ESP project. Then, the esp-subscribe.sh (Linux, Solaris) or esp-subscribe.bat (Windows) file reads the row and displays it in the console.

Prerequisites
Set JAVA_HOME:
Task
  1. Set the user name and password in the example environment:
    Operating System Step
    Windows
    1. Edit the set_example_env.bat script
    2. Set the ADAPTER_EXAMPLE_USERNAME and ADAPTER_EXAMPLE_PASSWORD variables to sybase.
    UNIX
    1. Edit the set_example_env.sh script
    2. Set the ADAPTER_EXAMPLE_USERNAME and ADAPTER_EXAMPLE_PASSWORD variables to sybase.
  2. On Windows only, modify the set_example_env.bat file:
    • Remove the line:
      call "%~dp0..\..\..\set_adapter_env.bat"
    • Add the lines:
      call set_example_env.bat
      call %ADAPTER_EXAMPLE_DEPTH%\set_adapter_env.bat
  3. In the XPathXmlStreamReader.props file, append sybase to the following lines to set the user and password variables:
    adapter.ASAPSINK.User = 
    adapter.ASAPSINK.Passwd = 
  4. Run the example:
    Operating System Step
    UNIX
    1. Open a terminal window and run ./start_server_cluster.sh to start the server cluster.
    2. In a second terminal window, run ./start_project.sh to start the project.
    3. In the same terminal window, run ./esp-subscribe.sh to subscribe to the project running on the cluster.
    4. In a third terminal window, run ./XPathXmlStreamReader.sh to start the FilePollSource (with XPathXmlStreamReader) and AsapSink components.
    Windows
    1. Open a command window and run start_server_cluster.bat to start the server cluster.
    2. In a second command window run start_project.bat to start the project.
    3. In the same command window, run esp-subscribe.bat to subscribe to the project running on the cluster.
    4. In a third command window, run XPathXmlStreamReader.bat to start the FilePollSource (with XPathXmlStreamReader) and AsapSink components.
    The example runs and the output displays in the second terminal/command window.
Related reference
XPathXmlStreamReader Properties