Supplier catalogs

How to extract color from YML param name="Color"

2026-06-29
Task

YML product characteristics are stored in repeated param nodes: Color, Material, and others. The import needs a separate <Color> field, and the source param list should not be mixed into the result.

Short answer

First create a new <Color> node inside offer. In its settings, set Current value any -> replace with the param value, but only if @name equals Color or contains substring Color. Regular expression ^Color$ only checks an exact full match.

How to do it in Eofferix

  1. Inside the repeated offer, create a new child node <Color>.

  2. Open the value settings of the new <Color> node.

    Opening color settings
    The settings are applied to the new output color field.
  3. Method 1: add a rule Current value any, action Replace with value from param; the rule condition is @name Equals Color.

    Equals condition for color
    Exact comparison works when the file uses the short Color label.
  4. Method 2: if the supplier writes Product color, use @name Contains substring Color.

    Contains substring condition for color
    This variant avoids a regular expression for longer parameter names.
  5. Method 3: keep regular expression ^Color$ (matches an exact Color value) as the strict option.

    Regex condition for color
    Regex is needed only for a strict exact-match check.
  6. On the source param nodes, disable export of the color row or of the whole helper parameter list if it is no longer needed in the result.

Before / after

Before

source data
<yml_catalog date="2026-06-29 10:00">
  <shop>
    <offers>
      <offer id="YML-11001">
        <name>Hudson lamp</name>
        <param name="Color">white</param>
        <param name="Material">steel</param>
      </offer>
      <offer id="YML-11002">
        <name>Parker chair</name>
        <param name="Color">black</param>
        <param name="Material">wood</param>
      </offer>
    </offers>
  </shop>
</yml_catalog>

After

result
<offers>
  <offer id="YML-11001">
    <name>Hudson lamp</name>
    <Color>white</Color>
  </offer>
  <offer id="YML-11002">
    <name>Parker chair</name>
    <Color>black</Color>
  </offer>
</offers>

Process data faster with Eofferix

Create a free account to automate catalogs and price lists around your own rules.

Sign up