-
- var $page = $(pageXml).find("page");
- var oldRevision = $page.attr("revision");
- var defaultType
- = $page.attr("isBinary") == "yes" ? "binary"
- : $page.attr("type") == "text/x-rakka" ? "rakka"
- : $page.attr("type") == "text/css" ? "css"
- : $page.attr("redirect") != null ? "redirect"
- : "unknown"
- ;
- var isLocked = $page.attr("isLocked") == "yes";
- var source
- = $page.attr("redirect") != null ? $page.attr("redirect")
- : $page.find("textData").text()
- ;
- var summary = $page.find("summary").text();
+
+ if (pageXml.documentElement.tagName == "page") {
+ var $page = $(pageXml).find("page");
+ var oldRevision = $page.attr("revision");
+ var defaultType
+ = $page.attr("isBinary") == "yes" ? "binary"
+ : $page.attr("type") == "text/x-rakka" ? "rakka"
+ : $page.attr("type") == "text/css" ? "css"
+ : $page.attr("redirect") != null ? "redirect"
+ : "unknown"
+ ;
+ var isLocked = $page.attr("isLocked") == "yes";
+ var source
+ = $page.attr("redirect") != null ? $page.attr("redirect")
+ : $page.find("textData").text()
+ ;
+ var summary = $page.find("summary").text();