Prevent annoying error message from CTX detectWeb() if page isn't valid XML
This commit is contained in:
parent
f4dfc13eab
commit
083b3ba9a9
1 changed files with 6 additions and 1 deletions
|
@ -129,7 +129,12 @@ function detectInString(text) {
|
||||||
* specification.
|
* specification.
|
||||||
*/
|
*/
|
||||||
function contextObjectXMLToCOinS (text) {
|
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 */
|
/* Here and elsewhere, we are using the E4X syntax for XML */
|
||||||
var objects = doc..*::["context-object"];
|
var objects = doc..*::["context-object"];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue