Convert Excel to XML
Upload your spreadsheet and download well-formed XML, with one element per row and titles turned into valid names.
XML that opens on the first try
The classic problem when building XML by hand is that a single invalid element name — a space, an accent in the wrong place, a title starting with a number — stops the whole file from opening. Here the names are always sanitised before they are written.
The structure is predictable: a root element containing one element per data row, and inside each row one field per column. The first row of the sheet is used as the field names, so it is required.
Sanitised element names
Column titles are turned into valid XML names: any disallowed character is
replaced with _, and if the resulting name begins with a character that cannot
start an XML name, a _ is prepended. A title that is empty, or ends up empty
after sanitising, is given a fallback name columna1, columna2, and so on.
You can change the root element name (default datos) and the row
element name (default fila). Both go through the same sanitising, so if you
type something invalid it is corrected rather than breaking the file.
Elements or attributes
The style option decides how each row's values are stored:
- Elements puts each value in its own child element:
<fila><name>Ana</name></fila>. It is the most readable form and what most transformation sheets expect. - Attributes puts the values as attributes of the row element:
<fila name="Ana" />. It is smaller and works well when each row is short, flat data.
In both cases values are written with XML's own escaping: reserved characters
such as <, > and &, and quotes inside an attribute, are turned into their
entities. The file is always well-formed.
How values are formatted
Values are emitted in a neutral format, not according to regional settings: a
dot decimal separator for numbers and YYYY-MM-DD dates. The document carries
its <?xml version="1.0" encoding="utf-8"?> declaration and is downloaded as
UTF-8 with a BOM, so accented characters survive when any parser opens it.
Frequently asked questions
Does it generate a schema (XSD) or a DTD?
No. Only the well-formed data document is generated. If your process needs to validate against a schema, you will have to supply it separately.
What if two columns share the same title?
Both produce elements — or attributes — with the same name. With elements that is valid XML and both are kept; with attributes, an element cannot repeat an attribute, so it is worth renaming the column before converting.
Does it convert every sheet in the workbook?
Only the first one. Convert the others separately and adjust the root element name on each pass.
Are data types preserved?
XML is text: every value comes out as a string, but in a neutral, unambiguous format. If you need numbers to stay numbers for the consumer, use Excel to JSON.
What about formulas and formatting?
Each cell's computed value is exported; formulas and visual formatting are not preserved. To keep the presentation, see Excel to HTML.