commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vladimir Stevanovic <vstevano...@emisia.net>
Subject [configuration] backslash escaping
Date Thu, 09 Jun 2011 09:05:51 GMT
HI,
I'm using XMLConfiguration with XPathExspressionEngine and I noticed a
strange bahavior of configuraiton framework


XMLConfiguration config = new XMLConfiguration();
config.setDelimiterParsingDisabled(true);
config.setExpressionEngine(new XPathExpressionEngine());
config.setFile(f);
if (!config.containsKey("paths")) {
    config.addProperty(" paths", "");
}
if (!config.containsKey("paths/path")) {
    config.addProperty("paths path", "c:\\some\\path");
}else {
    config.setProperty("paths/path", "c:\\some\\other\\path");
}
config.save();


Afrer running the code above for the first time, created xml file has
to following line:
<path>c:\some\path</path>

But afrer running again the line looks like this:

<path>c:\\some\\other\\path</path>

It seems that setProperty is performing some kind of escaping. What's
the reason for that?

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message