Hi everyone
I have an issue when using a series of XMLAppenders to combine various XML fragments into 1 document which is causing one of my namespaces to be removed and then prefixes to be added to my elements.
The first appender works as expected, but then the subsequent one seems to remove one of the tablespace names, and then cause all the existing elements from the document XML to then get the prefix “rsml”. The XML fragment in the 2nd appender doesn’t get the “rmsl” prefix however. I then use a 3rd appender and again this new xml fragment is added fine but still the original and 1st appended XML still have the “rmsl”.
My original XML document has the following 3 namespaces:
<railsysml version="0.7" extension="4" xmlns="http://www.rmcon.de/XMLSchema/railsysml/2019/infrastructure_0_7" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rsml="http://www.rmcon.de/XMLSchema/railsysml/2019/infrastructure_0_7">
1st appender – this is unchanged
2nd and 3rd Appender – this gets changed to <rsml:railsysml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rsml="http://www.rmcon.de/XMLSchema/railsysml/2019/infrastructure_0_7" version="0.7" extension="4">
So it appears that the xmlns=http://www.rmcon.de/XMLSchema/railsysml/2019/infrastructure_0_7 is removed by the appender. I assume this is why my elements are then being prefixed with “rmsl”?
I can’t see anywhere in the XMLAppender transformer where I can set anything about Namespaces, so I’m not sure why this is happening? Does anyone have any advice?
I have attached an example workbench, input and output data.
(I should add I’m no XML expert, so apologies if some of my terminology above isn’t quite right!)
The structure of the output I’m after is broadly below but with no rmsl: prefix on any of the elements, and i guess all 3 namespaces I list above?
I have also tried just using a StringReplacer at the end of my workflow to remove any “rsml:” strings but with my full data my XML is about 2 million lines long so this transformer was taking too long to run (I left it overnight and it still hadn’t finished). So it would be better for me to fix the issue from happening in the 1st place.
Thanks in advance
Steph