checkLinks/other_checkLinks.R

checkInternalLinks =
function(doc)
{  
   to = getNodeSet(doc, "//a/@href")
   to = grep("^#", to, value = TRUE)

   ids = getNodeSet(doc, "//a/@name")
   to[ is.na(to %in% ids) ]
}

checkExternalLinks =
function(doc)
{
   to = getNodeSet(doc, "//a/@href")
   to = grep("^#", to, value = TRUE, invert = TRUE)

}

checkImages =
function(doc)
{
  hf = xpathSApply(doc, "//img", xmlGetAttr, "src")
  hf[!file.exists(hf)]
}
cosmicexplorer/xmlr documentation built on May 30, 2019, 8:28 a.m.