Page 1 of 1

select specific xml-value

Posted: Thu Jun 29, 2023 9:37 am
by FlorianDSK
Hello all

Is there any way to change a specific xml-value in Switch BUT only if the word 'bumper' occurs in that row for example and and all other values that may appear remain untouched?

As an illustration:

XML1
/jobs/order/productDescription = bumper (finds bumper and changes this value e.g. to adhesive foil outdoor)
XML2
/jobs/order/productDescription = sticker (does NOT find the value bumper and thus remains unchanged)

Many thanks

Florian

Re: select specific xml-value

Posted: Thu Jun 29, 2023 9:55 am
by jan_suhr
The String Replace app should do the job for you.
https://www.enfocus.com/en/appstore/pro ... ng-replace

Re: select specific xml-value

Posted: Thu Jun 29, 2023 3:58 pm
by FlorianDSK
Hello Jan,

That worked out great.

Many thanks

Re: select specific xml-value

Posted: Tue Aug 01, 2023 9:47 am
by FlorianDSK
The tool shows a strange action.

It searches for a certain value in a total node and then exchanges it with another value.
However, if this value is not present, it writes this value to the beginning of the XML.

As an example:
XML structure

<?xml version="1.0" encoding="UTF-8" ?>
Jobs
Job
item: Indoor sticker, A6, laminate
Format: A6
Job
item: Outdoor sticker; A7, without laminate
Format: A7
Job
Article: Special sticker, free format, without laminate
Format: 210x210

It searches for free format and replaces it with the value it finds in 'format'.
Now he notes all the values in Format, even in the nodes where there is no free format, and writes them to the beginning of the XML:

A7A6<?xml version="1.0" encoding="UTF-8" ?>
Jobs
Job
item: Indoor sticker, A6, laminate
Format: A6
Job
item: Outdoor sticker; A7, without laminate
Format: A7
Job
Article: Special sticker, 210x210, without laminate
Format: 210x210

How can you get around that?

Many Thanks