jeudi 18 janvier 2018

XML IF ELSE statement

For a Google Shopping feed I need to give Google some variables of products I have.

Case: There are 3 Unique Product Identifiers:

<!-- Unique Product Identifiers-->
<g:brand>{manufacturer}</g:brand>
<g:gtin>{upc}</g:gtin>
<g:mpn>{sku}</g:mpn>

And one way to say if it's true or false:

<g:identifier_exists>TRUE</g:identifier_exists>

The g:identifier_exists should be true of 1 of the 3 identifiers is filled in (not null/empty). If all 3 are empty then the identifier should be FALSE. Like this:

<g:identifier_exists>FALSE</g:identifier_exists>

Is this possible with XML?

Aucun commentaire:

Enregistrer un commentaire