select specific xml-value

Post Reply
FlorianDSK
Newbie
Posts: 18
Joined: Fri May 26, 2023 2:35 pm

select specific xml-value

Post 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
Last edited by FlorianDSK on Tue Aug 01, 2023 9:47 am, edited 2 times in total.
jan_suhr
Advanced member
Posts: 592
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: select specific xml-value

Post by jan_suhr »

The String Replace app should do the job for you.
https://www.enfocus.com/en/appstore/pro ... ng-replace
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
FlorianDSK
Newbie
Posts: 18
Joined: Fri May 26, 2023 2:35 pm

Re: select specific xml-value

Post by FlorianDSK »

Hello Jan,

That worked out great.

Many thanks
FlorianDSK
Newbie
Posts: 18
Joined: Fri May 26, 2023 2:35 pm

Re: select specific xml-value

Post 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
Post Reply