XML File Data Parsing

  • Last update: December 27, 2024
  • Overview

    Application Scenario

    You may want to parse an offline XML file into a two-dimensional table and store it in a database.

    2024-12-24_15-20-48.png

    Implementation Method

    Upload the XML file to the FTP server or place the file in the webroot folder of the FineDataLink project.

    Use the API Input function to access the XML file, parse the file using the XML Parsing operator, and store the data in the database.

    Procedure

    You can download the sample file XML_sample.zip.

    Placing the XML File

    Upload the XML file to the FTP server or place the file in the \webapps\webroot path in the FineDataLink installation directory.

    The XML file in this example is placed in the /linux_EN/webapps/webroot path in the FineDataLink installation directory, as shown in the following figure.

    Screenshot 2024-12-26 at 15.42.28.png

    iconNote:
     You can also create other folders in the webroot folder and adjust the access path accordingly in subsequent steps.

    Access the XML file in the browser using https://FineDataLink IP address:Port number/webroot/XML file name.

    2024-12-24_14-55-33.png

    Reading File Data using the API Input Operator

    Create a scheduled task, add the Data Transformation node, click the added Data Transformation node to enter the editing page, add the API Input operator, and fill in the address of the uploaded XML file for data fetching, as shown in the following figure.

    2024-12-24_15-11-52.png

    Click Data Preview to view the fetched XML file data, as shown in the following figure.

    2024-12-24_14-54-12.png

    Parsing the XML File

    Use the XML Parsing operator to parse the XML data, and specify a namespace for the fetched XML data, as shown in the following figure.

    2024-12-24_14-58-16.png

    Click Select XML Node to select the fields to be parsed, as shown in the following figure.

    2024-12-24_15-01-33.png

    Click Data Preview to view the tabular data after parsing, as shown in the following figure.

    2024-12-24_15-01-56.png

    Outputting Data to a Database Table

    Use the DB Table Output operator to store the parsed upstream data in the database, as shown in the following figure.

    2024-12-24_15-03-35.png


    Effect Display

    After you save and run the task, the XML file data is stored in the target database, as shown in the following figure.

    2024-12-24_16-20-39.png

    附件列表


    主题: Data Development - Scheduled Task
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy