@@ -9,20 +9,21 @@ var utils = require("./utils");
9
9
10
10
var parseXml ;
11
11
12
- if ( typeof window . DOMParser != "undefined" ) {
13
- parseXml = function ( xmlStr ) {
14
- return ( new window . DOMParser ( ) ) . parseFromString ( xmlStr , "text/xml" ) ;
15
- } ;
16
- } else if ( typeof window . ActiveXObject != "undefined" &&
17
- new window . ActiveXObject ( "Microsoft.XMLDOM" ) ) {
18
- parseXml = function ( xmlStr ) {
19
- var xmlDoc = new window . ActiveXObject ( "Microsoft.XMLDOM" ) ;
20
- xmlDoc . async = "false" ;
21
- xmlDoc . loadXML ( xmlStr ) ;
22
- return xmlDoc ;
23
- } ;
12
+ if ( typeof window != "undefined" ) {
13
+ if ( typeof window . DOMParser != "undefined" ) {
14
+ parseXml = function ( xmlStr ) {
15
+ return ( new window . DOMParser ( ) ) . parseFromString ( xmlStr , "text/xml" ) ;
16
+ } ;
17
+ } else if ( typeof window . ActiveXObject != "undefined" &&
18
+ new window . ActiveXObject ( "Microsoft.XMLDOM" ) ) {
19
+ parseXml = function ( xmlStr ) {
20
+ var xmlDoc = new window . ActiveXObject ( "Microsoft.XMLDOM" ) ;
21
+ xmlDoc . async = "false" ;
22
+ xmlDoc . loadXML ( xmlStr ) ;
23
+ return xmlDoc ;
24
+ } ;
25
+ }
24
26
}
25
-
26
27
/**
27
28
* @private
28
29
* @global
@@ -116,7 +117,7 @@ function callParseFunctions(tagName, node, options) {
116
117
}
117
118
118
119
/**
119
- * Parses a (EO-)WCS response to JavaScript objects.
120
+ * Parses a (EO-)WCS response to JavaScript objects.
120
121
*
121
122
* @param xml the XML string to be parsed
122
123
* @param options options for parsing
0 commit comments