Jump to content
  • Spotfire Tips & Tricks: Load XML data into Spotfire


    XML stands for eXtensible Markup Language and it was designed to store and transport data. It is information or data wrapped in tags and the author of the XML Document defines these tags. The popularity of XML data can be attributed to its ability to store hardware and software-independent data in plain text format for easy sharing and transportation.

    It leads to easier expansion or upgrades to new operating systems, new applications, or new browsers, with no data loss.

    Load XML into Spotfire

    In this example, we will walk through steps to load unstructured data format like XML into Spotfire as a structured data table for data analysis. Our XML data source can be a local file or accessible via HTTP or FTP.

    Install XML Package using TERR tools

    Install XML package available at CRAN provides tools for parsing and creating XML in R.



    Note that there are other packages available to parse XML but we are using XML for this example.

    Create a Data function to Load XML

    Once the required package is loaded xmlTreeParse or xmlParse can be used to generate the R structure. Click here for details about XML Package.

    xmlToDataFrame can be used to generate Dataframe from XML source. This output DataFrame can be defined as Output Parameter which returns the type Table and this Table is where the user can view XML contents as Table.



    This script can easily bring XML data into Spotfire for further Analysis. The data function can be executed with a click of a button or can refresh Automatically.



    Click here for a live demonstration of this example in Dr. Spotfire Office Hours 23 May 2017 Session.

    User Feedback

    Recommended Comments

    There are no comments to display.

  • Create New...