Invalid document error for snippet template


When I try to select (not even perform) an R script (mahalanobis distance) from a template via R-snippet in Knime, it gives an error:



The given template is not a valid rgg-xml document.


The error occurs on some computers, but not all, with templates from all sources, but not with all templates within the same template file (???). It also occurs with the standard file, which makes me think it's because of settings or something in KNIME. Also it worked fine on the same computers, before, and I don't remember changing anything.

I'm using KNIME 2.4.2.

Does anyone have experience with this error, know how it is caused, or better yet, know how to fix it?

Thanks in advance,


Hi Maarten,

sounds weird. Can you give me some more details?

Can you reproduce which template from the "standard file" throws the error on which computer? Which version of the scripting extension do you have installed?

I've never observed this problem so far (I'm working with KNIME 2.4.2 too) but I'm curious why you get this error...


Hi Antje,

Thanks for replying!

The mahalanobis distance calculation from screenmining from the template file in the link doesn't work, on my computer and laptop, while with colleagues that use the same version, templates etc can just get it to work. I've found out that in another workflow, it does work. How this is possible, I don't know, but I think I might just be able to solve it by rebuilding the workflow. I'll confirm that once it's done.

The weird thing that I still don't understand about this is that other templates from the same file (Chisquare for our own templates, and most of the other templates for the online file) do work.

Thanks again,


OK, I solved it, and I know what caused the problem:

the 'treatment' column, which determines the negative control group in the distance calculation, had 4 values (string), amongst which:

"A&E". Only when I removed the "&" did everything get working again. 

So bottom line is: avoid strange characters in your dataset.

Thanks anyway!

I'm glad that you could solve it. One of my points on the todo list is to forward the actual R error message to KNIME to provide a better idea why a script throws an error.