Up: Component summary Component

XML2CSV

Transforms an XML file into CSV table.

Version 1.2
Bundle tools
Categories
Authors Vladimir Rogojin (vladimir.rogojin@helsinki.fi)
Issue tracker View/Report issues
Source files component.xml XML2CSV.java
Usage Example with default values

Inputs

Name Type Mandatory Description
in XML Mandatory An XML file to be transformed

Outputs

Name Type Description
out CSV The transformed CSV file is the table of the tags, that represents their hierarchy in the XML document, their content and parameters. The file contains the following columns:
  • #TID# - The unique ID for a tag (generated by the component)
  • #PID# - The unique ID of its parent
  • #PPID# - The dot-separated sequence of all tag's parents in the hierarchy
  • #NAME# - The name of the tag (for instance, <a href="http://www.google.com"> has name "a")
  • #CONTENT# - The content of the tag (for instance, <a href="http://www.google.com"> bla-bla-bla</a> has content "bla-bla-bla"). Warning: quotes in the tag content are not handled correctly!
  • <---a-parameter---> - a parameter of the tag (for instance, <a href="http://www.google.com"> bla-bla-bla</a> has parameter "href" with the value "http://www.google.com"). The CSV table contains a column for each tag parameter found in the XML document

Parameters

Name Type Default Description
includeNonLeafContent boolean false Should the table contain the content of non-leaf tags? Note, that the content of each tag contains also the content of all of its children tags.
includeSource boolean false If TRUE, the row #TID#=-1,#PID#=NA,#PPID#=NA,#NAME#=SOURCE_XML,#CONTENT#=<---PATH-TO-THE-SOURCE-XML-FILE---> is added to the output table.
newLineSplitter string "\\n" Replacement for the new line symbol in the output table

Test cases

Test case Parameters IN
in
OUT
out
case1 properties in (missing)

includeNonLeafContent = true

case2 (missing) in (missing)

Generated 2019-02-07 07:42:33 by Anduril 2.0.0