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)]
}

Try the XML package in your browser

Any scripts or data that you put into this service are public.

XML documentation built on July 16, 2018, 1:01 a.m.