Felix:
Try this:
Let's say the column which has the cell with XML data has a header name of "XML Data"
click on the caret for the column header (XML Data) to get the context menu.
- XML Data > Edit column > Add column based on this column...
- [In the resulting dialog box],
- Set "New Column Name" to "XML Text" (or whatever you like)
- In the Expression box: value.parseHtml().select("datafield")[0].htmlText()
If you type the expression in, one part at a time, you can watch the processing in the Preview pane. There are 5 parts to the the GREL expression.
e.g.
- value -- shows the Raw XML unprocessed
- value.parseHtml() -- converts the XML to an HTML document
- .select("<<insert tag name here>>") -- selects a tag-name. In this case you can either use "datafield" for the outter tag, or "subfield" as the inner tag.
- [0] -- takes the first element of the array. You know your results are in an array because the processed preview window shows the data preceded by an open bracket "[", and followed by a close bracked "]". In this case there is only one element in the array -- you know this because there is no comma separating values within the array.
- .htmlText() -- takes the text within the tag
By using the following expression, you could also extract the subfiled attribute, i.e. the subfield code, into a separate column to retain subfield data
value.parseHtml().select("subfield")[0].htmlAttr("code")