CSV to XML Converter

Map spreadsheet columns to XML elements or attributes, group rows by a column, preview the first records and download well-formed XML.

Działa w Twojej przeglądarce. Twoje pliki nigdy nie opuszczają urządzenia. Zobacz, jak to sprawdzić

…

Jak to zrobić

  1. 1
    Load the data

    Open a CSV, TSV or Excel file, paste CSV, or tap Sample.

  2. 2
    Name the document

    Set the root element and the row element names.

  3. 3
    Map columns

    For each column set the XML name and choose element, attribute, row text or skip.

  4. 4
    Group if needed

    Choose a group column and the group element and attribute names.

  5. 5
    Handle empty cells

    Choose empty element, leave out or xsi:nil, and set indent and declaration.

  6. 6
    Check and download

    Read the preview, fix warnings, then copy or download the full XML.

O tym narzędziu

Plenty of systems still exchange data as XML: product feeds for marketplaces and price comparison sites, import files for accounting and ERP software, sitemaps, Android resources, test fixtures and many government upload portals. The data usually starts life in a spreadsheet, and the gap between the two is wider than it looks. Column headers such as Unit Price (EUR) are not valid XML names, ampersands and angle brackets in descriptions must be escaped, some fields belong in attributes rather than elements, and some importers want records grouped under a category element. This converter handles each of those points. It reads CSV with any common delimiter, TSV and the first sheet of an Excel file, turns every header into a valid XML name, and lets you decide per column whether it becomes a child element, an attribute of the row, the text content of the row, or is skipped. You name the root and row elements, and the preview shows the first rows as you change things.

Mapping columns

Each row of the mapping table has the original header, the XML name, the role and a CDATA box. Names are cleaned automatically: spaces become underscores, accents are removed, a name that starts with a digit gets a leading underscore and names that start with xml, which the XML specification reserves, are prefixed too. A name you type that is still invalid is outlined in red and is repaired when written. The CDATA option wraps a text value in a CDATA section, which some importers prefer for HTML descriptions; a value that itself contains ]]> is split safely.

Grouping, empty cells and namespaces

Group rows by column collects all rows with the same value under one group element with the value as an attribute, for example a category element with name="Tea" around the tea products. Empty cells can be written as empty elements, left out, or marked xsi:nil="true" for schemas that require explicit nils; the namespace declaration for xsi is added for you. A default namespace URI can be set on the root element. Indentation and the XML declaration are optional.

Escaping

Element text escapes &, < and >. Attribute values also escape double quotes, tabs and line breaks as character references so they survive parsing. Control characters that XML 1.0 does not allow are removed rather than producing a file no parser will open.

Limits

The converter writes one flat level of fields per row plus optional grouping; it does not build arbitrary nested structures from a single column or validate the result against an XSD schema. Check the importer's documentation for required element order. Excel files are read from the first sheet with values, not formulas, and very large files are limited by browser memory.

Przykład z rozwiązaniem

A shop owner has a four-row product sheet with the headers sku, name, category, price, currency, stock and description. With root products and row product, sku set to Attribute and grouping by category, the result contains two category elements. Tea holds TEA-250 and TEA-500, and Kitchen holds MUG-01 and KET-02. The description Strong & malty black tea is written as Strong &amp; malty black tea, and dishwasher <safe> becomes dishwasher &lt;safe&gt;. Setting Empty cells to Leave out drops the empty description of TEA-500 entirely. The download products.xml opens without errors in a browser.

W skrócie

Najczęstsze pytania

Can I put some columns in attributes?

Yes. Set Write as to Attribute for those columns. Attributes are written on the row element in the order of the columns.

What does Row text do?

It puts one column's value inside the row element itself, for example <name id="7">Alice</name>. Only one column can have that role, and other element columns are then ignored for that row.

Why was my column name changed?

XML names cannot contain spaces or most punctuation and cannot start with a digit or with xml. The tool suggests a valid name, which you can edit.

Can I open an Excel file?

Yes, .xlsx files are read in the browser. The first sheet is used, with the first row as headers.

Does it validate against my XSD?

No. It produces well-formed XML with your names. Use the importer's own validator or an XSD tool to check required elements and types.

Is my spreadsheet uploaded?

No. Parsing and conversion happen on your device; the mapping and options are stored locally so you can continue later.

Całkowicie za darmoBez opłat i rejestracji
Pliki zostają prywatneWszystko działa w Twojej przeglądarce
Łatwo w Twoim językuDostępne w wielu językach