I am looking for a way to create a new node from existing node and remove the searched string from existing node.
Example:
<RSS>
<ITEM>
<PRODUCT_ID>86258</PRODUCT_ID>
<EAN>8595174240939</EAN>
<PRODUCT_NAME>Apple T-Shirt, 16"</PRODUCT_NAME>
</ITEM>
<ITEM>
<PRODUCT_ID>86255</PRODUCT_ID>
<EAN>8595174240931</EAN>
<PRODUCT_NAME>Orange T-Shirt, 18"</PRODUCT_NAME>
</ITEM>
</RSS>
I would like to search for 16", 18" in the example above, I think regex \d+"$ (number + " + end of string) would do the trick. In the next step I would like to cut this searched string with the comma (,.*\d+"$)
Output.xml:
<RSS>
<ITEM>
<PRODUCT_ID>86258</PRODUCT_ID>
<EAN>8595174240939</EAN>
<PRODUCT_NAME>Apple T-Shirt</PRODUCT_NAME>
<SIZE>16"</SIZE>
</ITEM>
<ITEM>
<PRODUCT_ID>86255</PRODUCT_ID>
<EAN>8595174240931</EAN>
<PRODUCT_NAME>Orange T-Shirt</PRODUCT_NAME>
<SIZE>18"</SIZE>
</ITEM>
</RSS>