Eric Williams wrote:

I am trying to use some xml with the markup values of the xml'ish characters and NAnt it messing with them.

When setting the following property
<property name="MyString" value="&lt;CustomProps&gt;&lt;UseSSO vt='11'&gt;0&lt;/UseSSO&gt;&lt;Password vt='8' &gt;hello&lt;/Password&gt;&lt;UseProxy vt='11'&gt;0&lt;/UseProxy&gt;" />
<echo message="${MyString}" />

Returns:
[echo] <CustomProps><UseSSO vt='11'>0</UseSSO><Password vt='8' >hello</Password><UseProxy vt='11'>0</UseProxy>

I want:
[echo] &lt;CustomProps&gt;&lt;UseSSO vt='11'&gt;0&lt;/UseSSO&gt;&lt;Password vt='8' &gt;hello&lt;/Password&gt;&lt;UseProxy vt='11'&gt;0&lt;/UseProxy&gt;

This is an artifact of using XML as the underlying language for NAnt. The XML parser does the translation before NAnt ever sees it, so NAnt never gets to see the & entities.

Try adding an extra indirection by replacing each of your "&" with &amp, e.g.

<property name="MyString" value="&amp;lt;CustomProps&amp;gt;&amp;lt;... " />

Obviously this gets tedious. You may be better off just storing the data in a file, without any entity references. If you need to manipulate the data, filterchain and the xmlpeek/xmlpoke operations are available and are sufficient for easy stuff.
Gary




-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Nant-users mailing list
Nant-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to