How to render special characters in XML output

I am converting a CSV file to XML output and some data in the output XML will need to contain the special characters of " and < . Can I include those characters without the XML output showing them as " or < when output is to XML

For example a column with the value Credit card charges needs to look like below in the XML output

Credit Card Charges

When outputting to XML format:

  • quotes are converted to &quote;
  • < and > are also converted

Does that help?

My issue is I do not want them converted - cannot see that escape characters work with XML output to avoid this.

In the case of a csv input column of "Credit Card Charges’ and I want the output in the XML file to look like

Credit Card Charges

I cannot see how to achieve this. Apologies if just not understanding something basic but any way I try to get this output it puts in the &lt: and others which are not accepted as valid when the XML is processed

Did not realise it was stripping out the code output example in my reply

@GaryNZ
XML node values cannot contain greater than or less than characters. This is because they have a special meaning in XML. It is a limitation of XML, rather than of Easy Data Transform.

Discussing this is made more tricky by the forum stripping out some characters (greater than and less than characters are also encoded by the forum software).

Ok, I see what you are trying to do. That won’t work. But you can set an XML attribute on a node by putting a ‘_’ before the name of the attribute. For example:

See also:

Thanks for the reply - I see how that works now. I really like the flexibility of the program and sure it will be able to deliver what I need.

1 Like