In order to select a specific language from an multi-language element you need to specify the name of the parent of the element and the name of the element itself separated with a slash followed by the ed sign and the language.<PARENT_NAME>
/
<ELEMENT_NAME>
@lang='
<LANGUAGE>
'
Consider the following BmeCat4.0 file:
<BMECAT version="2005" xmlns="https://www.etim-international.com/bmecat/40%22 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance%22 xsi:schemaLocation="https://www.etim-international.com/bmecat/40 https://www.etim-international.com/bmecat_etim_40.xsd%22>
<HEADER>
<GENERATOR_INFO>DataProcessor, ProPlanet B.V., 's-Hertogenbosch, the Netherlands, email: info@proplanet.nl</GENERATOR_INFO>
<CATALOG>
<LANGUAGE default="true">dut</LANGUAGE>
<LANGUAGE>eng</LANGUAGE>
...
<T_NEW_CATALOG>
<PRODUCT mode="new">
<SUPPLIER_PID>AR1SC02</SUPPLIER_PID>
<PRODUCT_DETAILS>
<DESCRIPTION_SHORT>Schakelaar, 1-1,5mm2, 100 stuks</DESCRIPTION_SHORT>
<DESCRIPTION_SHORT lang="eng">Switch, 1-1,5mm2, 100 stuks</DESCRIPTION_SHORT>
...
This file contains 2 languages dut
(Dutch, which is the default language) and eng
.
In order to be able to select the exact language with a formula you should be aware of what languages exist in the document. In the formula you must specify the exact same value for the @lang
attribute.
For example when you want to select the DESCRIPTION_SHORT
in the Dutch (dut
) language you should use the following formula:
PRODUCT_DETAILS/DESCRIPTION_SHORT@lang='dut'
Because dut
is specified as the default language of the document this formula will result in the text that is in the DESCRIPTION_SHORT
without a lang
attribute: Schakelaar, 1-1,5mm2, 100 stuks
When you want to select the DESCRIPTION_SHORT
in the English (eng
) language you should use the following formula:
PRODUCT_DETAILS/DESCRIPTION_SHORT@lang='eng'
You can also combine multiple elements in one formula. The following example will select the Dutch language with a fallback to the English language when Dutch does not exists (for one of the products in the file).
ISNULL(PRODUCT_DETAILS/DESCRIPTION_LONG@lang='dut', PRODUCT_DETAILS/DESCRIPTION_LONG@lang='eng')
For Insbou, we don't need to follow the entire xml structure to get the correct formula part for an element.
Instead, we only use the 'main' parent and skip the tags in between. The main parents which are being used are:
PARENT_NAME |
---|
ProductLine |
TradeItemLine |
PriceInformation |
Furthermore, you don't need to add the 'Description' tag to your formula.
So, if you consider the following Insbou004 file:
<?xml version="1.0" encoding="utf-8"?>
<ProductData xmlns:xs="http://www.w3.org/2001/XMLSchema%22 xmlns="http://www.gs1.nl/productgegevens/insbou/004%22 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance%22 xsi:schemaLocation="http://www.gs1.nl/productgegevens/insbou/004 Productgegevens_insbou004.xsd">
...
<ProductLine>
...
<MultiLanguageProductDescriptions>
<Brand>
<Description>Draka</Description>
</Brand>
<ProductModel>
<Description>VDS kabelserie serie</Description>
<LanguageCode>nld</LanguageCode>
</ProductModel>
<ProductModel>
<Description>VDS cable series</Description>
<LanguageCode>eng</LanguageCode>
</ProductModel>
<ProductModel>
<Description>câble séries</Description>
<LanguageCode>fra</LanguageCode>
</ProductModel>
...
This file contains translations for dutch, english and french. Like for the BMECat, when you want to select the specific language, you need to specify the language in the formula. If, for example you would like the dutch ProductModel, you can use this formula:
ProductLine/ProductModel@lang='nld'
In the table below you can find a list of often used fields and their corresponding formula, for both BMECat and Insbou.
BmeCat 3.1 & 4.0
Field | DefaultMapping DataProcessor | Formula |
---|---|---|
DESCRIPTION_SHORT | Technical Description | PRODUCT_DETAILS/DESCRIPTION_SHORT@lang='dut' |
DESCRIPTION_LONG | Original (long) text | PRODUCT_DETAILS/DESCRIPTION_LONG@lang='dut' |
MANUFACTURER_TYPE_DESCR | PRODUCT_DETAILS/MANUFACTURER_TYPE_DESCR@lang='dut' | |
KEYWORD | PRODUCT_DETAILS/KEYWORD@lang='dut' | |
REMARKS | PRODUCT_DETAILS/REMARKS@lang='dut' | |
PRODUCT_STATUS | PRODUCT_DETAILS/PRODUCT_STATUS@lang='dut' | |
UDX.EDXF.PRODUCT_SERIES | Family (Series) | USER_DEFINED_EXTENSIONS/UDX.EDXF.PRODUCT_SERIES@lang='dut' |
UDX.EDXF.PRODUCT_VARIATION | Range (Type) | USER_DEFINED_EXTENSIONS/UDX.EDXF.PRODUCT_VARIATION@lang='dut' |
Insbou004
Field | DefaultMapping DataProcessor | Formula |
---|---|---|
ProductDescription | Technical Description | ProductLine/ProductDescription@lang='dut' |
LongProductDescription | Original (long) text | ProductLine/LongProductDescription@lang='dut' |
ProductModelDescription | Family (Series) | ProductLine/ProductModel@lang='dut' |
ProductVariationDescription | Range (Type) | ProductLine/ProductVariation@lang='dut' |
TradeItemDescription | Original text supplier | TradeItemLine/TradeItemDescription@lang='dut' |