Some of our XML files use Docbook, and dbcentx.mod is imported as per the normal pattern
<!ENTITY % dbcent PUBLIC
"-//OASIS//ENTITIES DocBook Character Entities V4.2//EN"
"dbcentx.mod">
%dbcent;
The problem we've found is that when we save our files, XCE dumps an entire copy of dbcentx.mod in the saved file where the "%dbcent;" tag is. Expanding entities is fine for validating the XML, but there's no way on god's green earth that XCE should be saving the result! I've tried turning off "expand internal entities on open", but that doesn't stop external entities like "%dbcent;" being expanded.
The only solution seems to be to not use this pattern in the first place - instead, go for something like
<!DOCTYPE log PUBLIC
"-//OASIS//ENTITIES DocBook Character Entities V4.5//EN"
"../../../tools/docbook-dtd-4.4b2/dbcentx.mod" [
<!ENTITY % sgml.features "IGNORE">
<!ENTITY % xml.features "INCLUDE">
]>
For another minor-but-important issue, XCE is also messing around with whitespace. Any single-line element with spaces before the terminating "/>" has the spaces removed. And if I resaved the DOCTYPE declaration above, all carriage-returns and spaces for the first three lines would be removed, to put it all on the same line. This may seem trivial, but if you've got a large file and you need to review diffs before you check in, you don't want to have to dig through a ton of warnings about whitespace because someone's tool has decided to move all the lines around. (Sure you can turn off whitespace in diffs. What happens if someone's "accidentallystuckwordstogether" in the help files you're going to print to a CD glass master?)
It's a shame, but it looks like until these are fixed then we're just going to have to go back to Notepad++. It's not ideal, but at least we know nothing's going to knacker our files there. :(
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Some of our XML files use Docbook, and dbcentx.mod is imported as per the normal pattern
<!ENTITY % dbcent PUBLIC
"-//OASIS//ENTITIES DocBook Character Entities V4.2//EN"
"dbcentx.mod">
%dbcent;
The problem we've found is that when we save our files, XCE dumps an entire copy of dbcentx.mod in the saved file where the "%dbcent;" tag is. Expanding entities is fine for validating the XML, but there's no way on god's green earth that XCE should be saving the result! I've tried turning off "expand internal entities on open", but that doesn't stop external entities like "%dbcent;" being expanded.
The only solution seems to be to not use this pattern in the first place - instead, go for something like
<!DOCTYPE log PUBLIC
"-//OASIS//ENTITIES DocBook Character Entities V4.5//EN"
"../../../tools/docbook-dtd-4.4b2/dbcentx.mod" [
<!ENTITY % sgml.features "IGNORE">
<!ENTITY % xml.features "INCLUDE">
]>
For another minor-but-important issue, XCE is also messing around with whitespace. Any single-line element with spaces before the terminating "/>" has the spaces removed. And if I resaved the DOCTYPE declaration above, all carriage-returns and spaces for the first three lines would be removed, to put it all on the same line. This may seem trivial, but if you've got a large file and you need to review diffs before you check in, you don't want to have to dig through a ton of warnings about whitespace because someone's tool has decided to move all the lines around. (Sure you can turn off whitespace in diffs. What happens if someone's "accidentallystuckwordstogether" in the help files you're going to print to a CD glass master?)
It's a shame, but it looks like until these are fixed then we're just going to have to go back to Notepad++. It's not ideal, but at least we know nothing's going to knacker our files there. :(