How to Convert / Cast a Column "String" into a "XML" type ?

Dear all,
A webservice is returning me an XML encoded content, that is handled as "String" by the webservice client.

I would therefore like to "cast" it as a XMLDocument, so that I can then apply Xpatch...

Can you please tell me how to do it ?
Thankyou

luca

I've tried the "Column to XML" node, however unfortunately that is always "prepending" its own XML declaration, and also "dexmlize" my input.

This is very easy to replicate: simply take a Table Creator node, and create an empty node with the following input

<?xml version='1.0' encoding='UTF-8'?><test>this is a test</test>

Then connect it to the Column to XML node using the defaults (content column: column1; custom name: cell) and then the result is:

<?xml version='1.0' encoding='UTF-8'?>
<cell>&lt;?xml version='1.0 encoding='UTF-8'>&lt;test>this is a test&lt;/test></cell>

Looking at the source code (this is one of the great Plus of KNME !!) this behaviour is confirmed, looking in the class ColumnToXMLCellFactory, the method getCell ignores the existence of an XML specification in the input, replaces "<" with &lt; and so on.

Therefore, at the moment I am still unable to get that data in ...

Hi Luca,

the "Column to XML" node is to be used if you want to compose new XML. Use the "String to XML" node to simply parse/cast a string with valid XML into the XML data type.

Regards,
  Bernd
 

Dear all,

the solution (provided by Bernd Wiswedel) is to use the "String to XML" node.

I do not know why I did not thought to use this node before ...

Anyhow it works perfectly !!!

THANKYOU and sorry for this noise.

Perhaps one could add to the FAQ:
Q: how to convert a String (containing XML) into XML?
Answer: use the node: "String to XML"; do not use "Column to XML".