[RFC] Using tidy to clean up profiles.
Kevin P. Fleming
kpfleming at linuxfromscratch.org
Tue Jun 22 18:20:50 PDT 2004
Thomas Pegg wrote:
> As suggested by Kevin in a previous thread, I've looked into using tidy
> on the xml of the profiles to clean them up and standardize the
> formatting. I have commited a few examples in the BLFS profile. In
> paticular in chapter04 heimdal.xml and mitkrb.xml are two files, that
> have been run through tidy. I did it only a few files, before a change
> like this was committed profile-wide.
Those look very nice to me, that's what I was hoping tidy would be able
> The entity reference issue is still a slight problem, the easiest way
> I've found to deal with it is sed the &'s back to an &. Around 95%
> of the time this works well except were there are actual &'s, in
> which case those have to be changed back manually, but since it's in a
> minority of the files, it's not a big problem. And really all files have
> to be run through tidy one time I think.
The solution I proposed before would work, but not until after the BLFS
profile is converted to use XInclude. For profiles that are using
XInclude, you can define an entity "real-amp" in general.ent that
produces an ampersand (just like & does), and then use that instead.
Tidy will mess with the leading ampersand of this entity reference too
(since it's not a standard entity), but doing a sed from & back to &
would fix it right back up, without any hand editing needed.
I don't know if this is really better, especially given that the BLFS
profile hasn't been converted to XInclude yet and that's a pretty big
job by itself. If someone was to run tidy, sed & back & and not
realize there had originally been an & in that file, then xmllint
will not validate the file and they will know something is wrong. That
should be good enough.
More information about the alfs-discuss