XMLSlice
Local processing · No uploads
Attribute mapping

Map XML attributes to clear CSV columns.

Preserve identifiers, currencies, SKUs, language codes, and other attribute values alongside element text without writing custom extraction code.

Open the private converter
Record attribute
@id
Child attribute
item/@sku
Missing value
Empty cell
Direct answer

The reliable conversion model

XMLSlice represents attributes with an @ prefix. An attribute on the selected record becomes @id, while an attribute on a nested child becomes a path such as item/@sku. This keeps attributes distinct from element names.

01

Understand the structure

What matters before conversion

Attributes remain attached to context

Prefixing attributes avoids collisions with element text and keeps nested ownership visible. order/@currency and item/@currency can coexist without ambiguity.

CSV safety applies to headers and values

Cells beginning with characters commonly interpreted as spreadsheet formulas are prefixed for safer opening in spreadsheet software.

Optional attributes become empty cells

If an attribute is absent on a record, the corresponding CSV cell is left empty rather than shifting later values into the wrong column.

02

Practical workflow

Convert in four clear steps

  1. 01

    Select the record element

    Choose the repeated element that owns the attributes, such as products/product.

  2. 02

    Review @ fields

    XMLSlice lists observed record and descendant attributes together with normal element paths.

  3. 03

    Keep identifiers and dimensions

    Select only attributes useful for analysis or import, such as @id, @lang, variant/@sku, and price/@currency.

  4. 04

    Verify the raw header behavior

    The CSV preview shows logical @ names; raw CSV may add a leading apostrophe to reduce spreadsheet formula interpretation.

03

Worked example

Product attribute example

Record-level and nested attributes become separate columns while element text remains unchanged.

Input XML
<products>
  <product id="P-10" active="true">
    <name lang="en">Notebook</name>
    <price currency="USD">12.50</price>
  </product>
  <product id="P-11" active="false">
    <name lang="de">Notizbuch</name>
    <price currency="EUR">11.80</price>
  </product>
</products>
Resulting CSV
'@id,'@active,name/@lang,name,price/@currency,price
P-10,true,en,Notebook,USD,12.50
P-11,false,de,Notizbuch,EUR,11.80
Selected fields@id, @active, name/@lang, name, price/@currency, price

The apostrophes are CSV injection protection. Most spreadsheet interfaces display the intended attribute labels without treating them as formulas.

04

Quality control

Conversion checklist

  • Distinguish record attributes from similarly named child attributes.
  • Confirm optional attributes produce empty cells where expected.
  • Treat IDs as text when leading zeros matter.
  • Review spreadsheet import types for dates, long numbers, and codes.
05

Questions and answers

Attributes FAQ

Why does XMLSlice use @ in attribute column names?

The prefix makes the source type explicit and prevents an attribute such as id from being confused with a child element named id.

Can attributes on nested elements be exported?

Yes. Their relative element path is preserved, producing labels such as price/@currency.

What happens when an attribute is missing?

The row remains aligned and the selected attribute column receives an empty cell.