Translate report data export from RUEI into HTML for import into OpenOffice Calc Spreadsheets

Posted by [email protected] on Oracle Blogs See other posts from Oracle Blogs or by [email protected]
Published on Mon, 06 Dec 2010 13:52:12 +0000 Indexed on 2010/12/06 16:58 UTC
Read the original article Hit count: 702

Filed under: Error when finding categories...
A common question of users is, How to import the data from the automated data export of Real User Experience Insight (RUEI) into tools for archiving, dashboarding or combination with other sets of data.

XML is well-suited for such a translation via the companion Extensible Stylesheet Language Transformations (XSLT). Basically XSLT utilizes XSL, a template on what to read from your input XML data file and where to place it into the target document. The target document can be anything you like, i.e. XHTML, CSV, or even a OpenOffice Spreadsheet, etc. as long as it is a plain text format.

XML 2 OpenOffice.org Spreadsheet

For the XSLT to work as an OpenOffice.org Calc Import Filter:

How to add an XML Import Filter to OpenOffice Calc

  1. Start OpenOffice.org Calc and
    select Tools > XML Filter Settings

    moz-screenshot-13.jpg.jpeg

  2. New...
    • Fill in the details as follows:
    Filter name: RUEI Import filter
    Application: OpenOffice.org Calc (.ods)
    Name of file type: Oracle Real User Experience Insight
    File extension: xml

    moz-screenshot-14.jpg.jpeg

  3. Switch to the transformation tab and enter/select the following leaving the rest untouched

    XSLT for import: ruei_report_data_import_filter.xsl

    Please see at the end of this blog post for a download of the referenced file.

    moz-screenshot-15.jpg.jpeg

  4. Select RUEI Import filter from list and Test XSLT

    Click on Browse to select
    Transform file: export.php.xml

    moz-screenshot-16.jpg.jpeg

    OpenOffice.org Calc will transform and load the XML file you retrieved from RUEI in a human-readable format.

    moz-screenshot-17.jpg.jpeg

  5. You can now select File > Open... and change the filetype to open your RUEI exports directly in OpenOffice.org Calc, just like any other a native Spreadsheet format.

    Files of type: Oracle Real User Experience Insight (*.xml)
    File name: export.php.xml

    moz-screenshot-18.jpg.jpeg

 
XML 2 XHTML

Most XML-powered browsers provides for inherent XSL Transformation capabilities, you only have to reference the XSLT Stylesheet in the head of your XML file. Then open the file in your favourite Web Browser, Firefox, Opera, Safari or Internet Explorer alike.

<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- inserted line below -->
<?xml-stylesheet type="text/xsl" href="ruei_report_data_export_2_xhtml.xsl"?>
<!-- inserted line above -->
<report>

You can find a patched example export from RUEI plus the above referenced XSL-Stylesheets here:


If you would like to do things like this on the command line you can use either Xalan or xsltproc.

The basic command syntax for xsltproc is very simple:

xsltproc -o output.file stylesheet.xslt inputfile.xml

You can use this with the above two stylesheets to translate RUEI Data Exports into XHTML and/or OpenOffice.org Calc ODS-Format. Or you could write your own XSLT to transform into Comma separated Value lists.

Please let me know what you think or do with this information in the comments below.

Kind regards,
Stefan Thieme


References used:




© Oracle Blogs or respective owner