I am trying to generate an xml file, which uses a lot of attributes.
One attribute, which is used quite often throughout the xml structure is the “xml:lang” attribute.
I would like to add the “xml:lang” attribute on the following elements: short-description, long-description, custom-attribute. It should look like this:
I tried to add a parent line in the control table for each element, but the attribute was only added to one of the three elements.
I was thinking about a workarond by adding multiple columns and change the output name with the display option in the control table. But the real XML file uses the xml:lang attribute on more than 30 elements, which would yield a very confusing workflow.
Here is a workflow with sample data.
Is it possible to add one attribute to multiple elements? Most likely @takbb could answer this quite easily?
I’m new with xml and knime, but I’ve a suggestion… Sometimes, I convert the xml structure as a string, apply a string manipulation with regular expression and convert to xml again… can it solve for you?
If you put a demo here, maybe can help you with it.
Well, I import yout project and at the component, I saw that you manipulate the string information and build the XML script.
My suggest is before the String conversion to XML, you add a string manipulation to add this info at the string if match and then, convert it to XML. At this point: