CDATA not handled correctly by UI
adam_hafner
Posts: 82 Silver 2
Within the `rgtool` XML the schema uses CDATA tags for containing information, in this specific case it is in the `description` node. However if the data in the CDATA tag contains a character that would otherwise required escaping, like the ampersand, it throws an error in the UI even though it is valid XML. This should be handled better so that it doesn't cause a parsing error. Here's an example:
```
```
Here is the error that is displayed:
I noticed that even when using the Script Generator via the UI, that if I put an ampersand in the `Description` it doesn't automatically convert the `&` to `&` either. That should also be addressed.
```
<?xml version="1.0" encoding="utf-8"?>
<tool version="1">
<description name="something" icon="data_unknown" version="1"><![CDATA[test&]]></description>
<author name="Bob" />
<tags>
<tag>SQLConcepts</tag>
</tags>
<ui>
<output displaytype="Grid | OutputLog" width="500" height="400" />
<block>
<control type="header" label="Select server and database" />
<control type="database" id="connection" />
</block>
</ui>
<script type="Sql"><![CDATA[SELECT 'THIS IS WHERE SQL WOULD GO';]]></script>
<signature />
</tool>```
Here is the error that is displayed:
I noticed that even when using the Script Generator via the UI, that if I put an ampersand in the `Description` it doesn't automatically convert the `&` to `&` either. That should also be addressed.
Tagged:
Answers
Hi @adam_hafner
Thank you for reaching out on the Redgate forum regarding your SQL Scripts Manager behavioural concern.
I've replicated this on my test system, there is a parsing error when there is an ampersand character (&) in the CDATA section. I am of the belief that CDATA should be able to parse that character within an XML format.
Along with your other feature requests, I'll escalate this to our development team to see if this is determined to be a bug.
In the interim, I'd recommend using text replacements for this character to generate valid scripts for the application to parse.