Convert XML to TSV using an API
Use our API to convert your XML data to Tab Separated Values
Convert
to
POST
https://dataconverter.io/api/v1/convert/xml-to-tsv
After signing up and verifying your email, you will be able to create an API Token in your account settings.
Headers
-
Authorization (required)
Bearer <<YOUR_API_TOKEN_HERE>>
Request Body — (multipart/form-data)
-
file (required)
string <binary>
-
uploadSettings
object
{ "treeNodes" : [ { "name" : "book", "fieldName" : "book", "xpathExpression" : "/bookstore/book", "recordBreak" : true, "field" : false }, { "name" : "title", "fieldName" : "title", "xpathExpression" : "/bookstore/book/title", "recordBreak" : false, "field" : true }, { "name" : "@lang", "fieldName" : "lang", "xpathExpression" : "/bookstore/book/title/@lang", "recordBreak" : false, "field" : true }, { "name" : "price", "fieldName" : "price", "xpathExpression" : "/bookstore/book/price", "recordBreak" : false, "field" : true } ] }
-
downloadSettings
object
{ "fieldSeparator" : "\t", "fieldNamesInFirstRow" : true, "startingQuote" : "\"", "endingQuote" : "\"", "newLine" : "\\n", "nullValuePolicy" : "EMPTY_STRING", "emptyStringValuePolicy" : "QUOTED_EMPTY_STRING", "forceQuote" : false, "charset" : "UTF-8" }
Request Sample
curl -X POST "https://dataconverter.io/api/v1/convert/xml-to-tsv" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-F "file=@data.xml;type=text/xml" \
-F "uploadSettings={\"treeNodes\":[{\"name\":\"book\",\"fieldName\":\"book\",\"xpathExpression\":\"/bookstore/book\",\"recordBreak\":true,\"field\":false},{\"name\":\"title\",\"fieldName\":\"title\",\"xpathExpression\":\"/bookstore/book/title\",\"recordBreak\":false,\"field\":true},{\"name\":\"@lang\",\"fieldName\":\"lang\",\"xpathExpression\":\"/bookstore/book/title/@lang\",\"recordBreak\":false,\"field\":true},{\"name\":\"price\",\"fieldName\":\"price\",\"xpathExpression\":\"/bookstore/book/price\",\"recordBreak\":false,\"field\":true}]};type=application/json" \
-F "downloadSettings={\"fieldSeparator\":\"\\t\",\"fieldNamesInFirstRow\":true,\"startingQuote\":\"\\\"\",\"endingQuote\":\"\\\"\",\"newLine\":\"\\\\n\",\"nullValuePolicy\":\"EMPTY_STRING\",\"emptyStringValuePolicy\":\"QUOTED_EMPTY_STRING\",\"forceQuote\":false,\"charset\":\"UTF-8\"};type=application/json" \
--output converted.tsv