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


    This article explains how to Load XML data into Spotfire

     

    Introduction

    XML stands for eXtensible Markup Language and it was designed to store and transport data. It is information or data wrapped in tags and author of 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 an 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 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.

    XML1.thumb.png.a8f86c78022dcfaebbda6f79920474e0.png

    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 required package is loaded xmlTreeParse or xmlParse can be used to generate 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 type Table and this Table is where the user can view XML contents as Table.

    xml2.thumb.png.0894009e8a3280ab3b92932e6dcc71ed.png

     

    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.

    xml3.thumb.png.09f0031ca5123d8c64c6390deddc84a8.png

     

    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...