Prevent annoying error message from CTX detectWeb() if page isn't valid XML

This commit is contained in:
Dan Stillman 2010-10-09 07:21:27 +00:00
parent f4dfc13eab
commit 083b3ba9a9

View file

@ -129,7 +129,12 @@ function detectInString(text) {
* specification.
*/
function contextObjectXMLToCOinS (text) {
var doc = new XML(text);
try {
var doc = new XML(text);
}
catch (e) {
return [];
}
/* Here and elsewhere, we are using the E4X syntax for XML */
var objects = doc..*::["context-object"];