In my XML file I am trying to use a path to a file; it starts like this:
<value key="myPath"><![CDATA[C:\Program Files\myFile.exe]]>
Then, when I launch my app it always says, can’t find file:
Can’t find file C:\Program
So, obviously it’s still getting caught up in the space between Program and Files. I thought my CDATA would fix that.
How wrong am I?
If I were designing this application, I would store URIs rather than filenames. That just seems the right approach in the kind of world where XML is usually used. But of course you can store anything you like in XML, and if the requirement is to store Windows filenames, then you are welcome to do so.
The fact that it doesn’t work has nothing to do with the XML. The receiving application that is extracting the filename from the XML and attempting to open the file is doing something wrong: it’s either messing up the filename itself, or it’s passing it to an API than can’t handle filenames containing spaces.