private void RemoveSpuriousLinks(HtmlDom pageDom)
{
// The validator has complained about area-describedby where the id is not found.
// I don't think we will do qtips at all in books so let's just remove these altogether for now.
foreach (XmlElement elt in pageDom.RawDom.SafeSelectNodes("//*[@aria-describedby]"))
{
elt.RemoveAttribute("aria-describedby");
}
// Validator doesn't like empty lang attributes, and they don't convey anything useful, so remove.
foreach (XmlElement elt in pageDom.RawDom.SafeSelectNodes("//*[@lang='']"))
{
elt.RemoveAttribute("lang");
}
// Validator doesn't like '*' as value of lang attributes, and they don't convey anything useful, so remove.
foreach (XmlElement elt in pageDom.RawDom.SafeSelectNodes("//*[@lang='*']"))
{
elt.RemoveAttribute("lang");
}
}