> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.stock-sync.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to map XML in Matching Column (Step 2) ?

In this XML, the mapping must begin with `{{ .. }}` & `data` and proceed down each level to the target node.

### Example 1: How to map specific fields XML data 

```json
[
  {
    "Aktif": "Evet",
    "UrunKartiID": "65",
    "UrunAdi": "Palomino Blackwing Replacement Eraser White Yedek Silgi Beyaz",
    "OnYazi": "",
    "Aciklama": "Değiştirilebilir, kare silgiler.&nbsp; Silginizi değiştirmek için, silgiyi ve klipsi halkanın dışına kaydırın, eski silgiden klibi çıkarın, yeni silgiyi klibe yerleştirin ve yeni silgiyi ve klipsi halkaya yerleştirin. Paket 10 adet silgi içermektedir.&nbsp;",
    "Marka": "BLACKWING",
    "MarkaID": "6",
    "SatisBirimi": "ADET",
    "KategoriID": "26",
    "Kategori": "Silgi",
    "KategoriTree": "KIRTASİYE/Silgi",
    "UrunUrl": "https://www.unmeiprojects.com.tr/palomino-blackwing-replacement-eraser-white-yedek-silgi-beyaz",
    "Resimler": {
      "Resim": "https://static.ticimax.cloud/54336/Uploads/UrunResimleri/blackwing-silgi-yedegi-10lu-9-b207.jpg"
    },
    "UrunSecenek": {
      "Secenek": {
        "Aktif": "Evet",
        "VaryasyonID": "65",
        "StokKodu": "BLCKWNGSLGYDG10",
        "Barkod": "BLCKWNGSLGYDG10",
        "StokAdedi": "0",
        "AlisFiyati": "3.75",
        "SatisFiyati": "196.63",
        "IndirimliFiyat": "0.00",
        "KDVDahil": "true",
        "KdvOrani": "10",
        "ParaBirimi": "tr-TR",
        "ParaBirimiKodu": "TRY",
        "Desi": "1",
        "EkSecenekOzellik": null
      }
```
Based on the above XML data, how should specific fields be mapped? 

* How to map `VaryasyonID` ?
`{{data.UrunSecenek.Secenek.VaryasyonID}}`

* How to map `Kategori` ?
`{{data.Kategori}}`

* How to map `Resim` ?
`{{data.Resimler.Resim}}`

### Example 2: How to map this XML data images with nested row

```json
{
  "variant_sku": "1023014652",
  "variant_title": "Helmet MTB Enduro 3.0 V23 Stealth Large - 59-63cm",
  "barcode": "6009554002779",
  "available": "1.00",
  "date_due_in": "15-JUN-2025",
  "qty_due_in": "8",
  "rrp": "499.00",
  "cost": "300.00",
  "group_id": "e819d190-80a9-e845-95e0-40f9fa72063f",
  "product_title": "Helmet MTB Enduro 3.0 V23 Stealth",
  "brand": "Leatt",
  "product_html": "The most versatile helmet you can buy! The Enduro 3.0 helmet...",
  "tags": null,
  "product_images": {
    "image": [
      "https://www.bikecorp.co.nz/Images/ProductImages/Large/1023034650.jpg",
      "https://www.bikecorp.co.nz/Images/ProductImages/Large/1023034650 2.jpg",
      "https://www.bikecorp.co.nz/Images/ProductImages/Large/1023034650 3.jpg",
      "https://www.bikecorp.co.nz/Images/ProductImages/Large/1023034650 4.jpg"
    ]
  }
}
```

* How to map `image`: This is different because the **image ground truth spans multiple rows**, requiring a specific mapping approach as described.
`["{{data.product_images.image | join: '","' }}"]`


### Example 3: How to map the XML data from certain category only

```json
"Std": {
  "Std": [
    {
      "Category": "body_colorgroup",
      "Code": "grey",
      "Label": "Grigio"
    },
    {
      "Category": "body",
      "Code": "grey",
      "Label": "Grigio"
    }
  ]
}
```

* How to map `Label` value when the Category is `body_colorgroup`
`{{ data.Std.Std | find: 'Category', 'body_colorgroup' | map: 'Label' }}`

### Example 4: How to map the XML data from two section of image link

```json
"g:id": "991943819",
    "g:identifier_exists": "no",
    "g:title": "Рейка декоративна PS горіх 2900х120х12мм SW-00001739",
    "g:description": "<p>Стінова рейка є елементом для обробки внутрішніх стін в інтер'єрі, має зовнішній вигляд, що імітує текстуру дерева.</p>\n<p><strong>Характеристики:</strong></p>\n<ul>"
    "g:link": "https://kabinet.dropoffice.com.ua/catalog/1644?source=merchant_center",
    "g:ads_redirect": "https://kabinet.dropoffice.com.ua/catalog/1644?source=merchant_center",
    "g:image_link": "https://kabinet.dropoffice.com.ua/uploads/cache/CatalogItems/CatalogItems1644/3b0069d04b-1_resize_1200x1200.jpg",
    "g:additional_image_link": [
      "https://kabinet.dropoffice.com.ua/uploads/cache/CatalogItems/CatalogItems1644/6c17370813-2_resize_1200x1200.jpg",
      "https://kabinet.dropoffice.com.ua/uploads/cache/CatalogItems/CatalogItems1644/76296ef619-3_resize_1200x1200.jpg",
      "https://kabinet.dropoffice.com.ua/uploads/cache/CatalogItems/CatalogItems1644/d7ffe098bc-4_resize_1200x1200.jpg",
      "https://kabinet.dropoffice.com.ua/uploads/cache/CatalogItems/CatalogItems1644/98b8f238b1-5_resize_1200x1200.jpg",
      "https://kabinet.dropoffice.com.ua/uploads/cache/CatalogItems/CatalogItems1644/504d739331-6_resize_1200x1200.jpg",
      "https://kabinet.dropoffice.com.ua/uploads/cache/CatalogItems/CatalogItems1644/9ed7fe1d03-7_resize_1200x1200.jpg",
      "https://kabinet.dropoffice.com.ua/uploads/cache/CatalogItems/CatalogItems1644/fd973cc6e8-8_resize_1200x1200.jpg"
    ]
```

* How to map `g:image_link and g:additional_image_link` value 
`["{{ data["g:image_link"] }}","{{data["g:additional_image_link"] | join: '","' }}"]`

### Example 5: How to map the XML data to make first letter in capitalize only

```json
"id": "991943819",
    "identifier_exists": "no",
    "tags": "ALL", "Bridal", "COLLECTIONS", "DRESSES", "EUPHORIA", "FORMAL AND PROM", "GOWNS", "IVORY", "Satin", "WHITE",
```

* How to map `tags` value to this `"All", "Bridal", "Collections", "Dresses", "Euphoria", "Formal and prom", "Gowns", "Ivory", "Satin", "White"]`
`{% for item in data.tags %}{{ item | capitalize }}{% unless forloop.last %};{% endunless %}{%- endfor -%}`


### Example 6: Selecting and extracting the value from a sub-array containing {"Name"=>"Garancija"}.

```json
    {"Attributes": {"Attribute"=>[[{"Name"=>"Barva"}, "črna"], [{"Name"=>"Kapaciteta"}, "2.500 strani"], [{"Name"=>"Tip"}, "Originalen toner"], [{"Name"=>"Garancija"}, "12M"]]}}
```

* How to map `12M` value to this `12`
`{{ data | jmespath: "Attributes.Attribute[?@[0].Name ==` Garancija``] | [0][1]" | remove: "M" }}`

### Example 7: Mapping Specific Image Sections

```json
{"Image": {"Image": "https://www.printmania.si/images/0004852_0.jpeg"}} 
{"Images": {"Image": ["https://www.printmania.si/images/0035117_0.jpeg", "https://www.printmania.si/images/0031754_0.png"]}}
```

* How to map `specific image`
`{{data | jmespath: "Images.Image" | json}}`

### Example 8: How to return second item in the array?

```json
{"Delivery": [{"Id"=>"1"}, "3"]}
```

* How to map second item array
`{{ data.Delivery[1] }}`

### Example 9: How to return first photo's URL in the array? 

```json
<photos>
                                <photo id="14334" main="1"><![CDATA[https://b2b.deltaoptical.pl/zasoby/import/l/lens-pen_4_1_2.jpg]]></photo>
                                <photo id="7627" main="0"><![CDATA[https://b2b.deltaoptical.pl/zasoby/import/l/lens-pen_1_1_2.jpg]]></photo>
                                <photo id="7628" main="0"><![CDATA[https://b2b.deltaoptical.pl/zasoby/import/l/lens-pen_15e72271ae777750b994ecd2b0a265cf.jpg]]></photo>
                                <photo id="7626" main="0"><![CDATA[https://b2b.deltaoptical.pl/zasoby/import/l/lens-pen_2_2_1.jpg]]></photo>
                                <photo id="7625" main="0"><![CDATA[https://b2b.deltaoptical.pl/zasoby/import/l/lens-pen_3_1_2.jpg]]></photo>
</photos>
```

* Example specific to get image that have **main** equal to **1**
`{{ data | jmespath: 'photos."photo"[?[0].main==`"1"`][] | [?type(@)==`string`] | [0]' }}`
