XML to Excel Converter with XPath Mapping
Turn product feeds, invoices and exports in XML into a spreadsheet you control, one row per repeating element and one column per XPath.
S'executa al teu navegador. Els fitxers mai no surten del dispositiu. Mira com comprovar-ho
…
Com es fa
- 1Open files
Drop one or more XML files on Open XML files, or paste XML and press Use pasted XML.
- 2Pick the row
Choose the Repeating element or type a Row XPath with predicates.
- 3Choose columns
Click suggested fields, press Use all suggestions or + Column and type an XPath.
- 4Tidy
Rename columns, reorder them with the arrows and choose how multiple values are handled.
- 5Batch options
With several files, choose Add a Source file column or One sheet per file.
- 6Export
Press XLSX, CSV or Mapping to download.
Sobre aquesta eina
XML is everywhere behind the scenes: supplier product feeds, e-invoices, bank and payroll files, sitemaps, RSS, GPX tracks, configuration exports and the data that public agencies publish. Opening such a file in Excel either fails or produces a strange table where nested elements are repeated or lost. The problem is that a spreadsheet needs to know what one row is. This converter asks exactly that question. It scans the document, lists the elements that repeat, with how many times and how many fields they hold, and proposes the most likely one, such as each product in a catalogue. It then lists every attribute and child value under the first row as a relative XPath, which you click to add as a column. You can rename columns, reorder them, edit any XPath by hand, add values from the parent element and use count, sum or concat. The table updates instantly and downloads as XLSX or CSV. The XML is parsed by code on this page and never uploaded.
The XPath you can use
Row paths and column paths accept absolute and relative location paths, the double slash for any depth, dot and dot-dot, the star for any element, attributes with the at sign, text(), and predicates: a position such as [1], last(), comparisons of attributes or child values with text or numbers, existence tests, contains, starts-with, not, and combinations with and and or. Column expressions may also be count(path), sum(path), name() and concat of paths and quoted text. When a column matches several values, for example two warehouses for one product, they are joined with a semicolon, or you can keep only the first.
Namespaces
Most real feeds use namespace prefixes such as cbc: or g:. With Ignore namespace prefixes switched on, the prefixes are dropped so paths stay short and match whatever prefix a file uses. Switch it off when two namespaces use the same element name and you need to tell them apart.
Many files at once
Select several files with the same structure and they are converted with the same mapping and stacked into one table, with an optional Source file column. Alternatively the XLSX can hold one sheet per file. Every workbook also gets a Mapping sheet that records the row XPath and each column path, and the mapping can be downloaded as JSON for documentation.
Limits
This is a fast, tolerant parser for well-formed documents, not a validating one: DTDs and XSD schemas are not checked, external entities are not loaded, and XPath functions beyond those listed are not supported. Very large files of hundreds of megabytes may exhaust a phone's memory. Mixed content, where text and elements alternate inside one element, is read as the joined text.
Exemple resolt
In the sample catalogue the converter finds /catalog/category/product repeated 3 times with 8 fields and proposes it as the row. The suggested columns give, for the standing desk, sku DSK-01, status active, name Standing desk, price 349.00, currency EUR, stock 12; 4 for the two warehouses BER; AMS, tags furniture; ergonomic, and parent name Office from ../@name. The lamp row shows Desk lamp & USB hub with the entity decoded and an empty tags cell. Changing the row XPath to //product[@status='active'] leaves 2 rows.
En resum
- Categoria: Desenvolupament i dades
- S'executa al navegador, sense registre, sense pujar res.
- La informació que introdueixes es queda al dispositiu.
- Disponible en anglès.
- Contingut revisat per última vegada:
- Font oficial: W3C XML Path Language (XPath) 1.0
Preguntes freqüents
Is my XML uploaded?
No. Parsing, XPath and the Excel file are all produced inside your browser.
What is the row XPath?
The path of the element that should become one row, such as /orders/order. Every column path is then read relative to that element.
How do I include a value from the parent?
Use .. to step up, for example ../@name for an attribute of the parent or ../../id for a field two levels up.
Can I combine many files?
Yes. Select them together. They share one mapping and are stacked, with a Source file column or one sheet per file.
What happens to repeated children?
They are joined with a semicolon in one cell, or you can keep only the first. Use count() to get how many there are.
Does it support namespaces?
By default prefixes are ignored so paths stay simple. Switch that off to match prefixed names exactly.
