I'm reading a whole xml file in as a string.
Some of the Node values are directories, e.g. "C:\"
When I print out the string, to make sure that the file has been read in correctly, I see that it has completely ignored the Nodes that have directories in them.
As an example, let's say the xml file has these 3 Nodes in it:
<Name>John</Name>
<Folder>C:\John</Folder>
<Time>12:30</Time>
When I print out the string that's supposed to read: "<Name>John</Name><Folder>C:\John</Folder><Time>12:30</Time>" it prints out
"<Name>John</Name><Time>12:30</Time>"
I tried to escape the \'s like this:
DataLine.replaceAll("\\", "\\\\");
but it throws an exception. I tested the line to see if it actually contained a "\" character ( Dataline.indexOf("\\") ) and it returns -1, meaning that the string does not contain that character.
Can anyone help me with this? I just want the xml string to contain ALL the nodes.
Thanks