diff --git a/src/dzitilesource.js b/src/dzitilesource.js index f5b75d69..eb283fab 100644 --- a/src/dzitilesource.js +++ b/src/dzitilesource.js @@ -222,6 +222,7 @@ function configureFromXML( tileSource, xmlDoc ){ var root = xmlDoc.documentElement, rootName = root.localName, + ns = xmlDoc.documentElement.namespaceURI, configuration = null, displayRects = [], dispRectNodes, @@ -233,7 +234,8 @@ function configureFromXML( tileSource, xmlDoc ){ if ( rootName == "Image" ) { try { - sizeNode = root.getElementsByTagName( "Size" )[ 0 ]; + sizeNode = root.getElementsByTagNameNS(ns, "Size" )[ 0 ]; + configuration = { Image: { xmlns: "http://schemas.microsoft.com/deepzoom/2008", @@ -255,10 +257,11 @@ function configureFromXML( tileSource, xmlDoc ){ ); } - dispRectNodes = root.getElementsByTagName( "DisplayRect" ); + dispRectNodes = root.getElementsByTagNameNS(ns, "DisplayRect" ); + for ( i = 0; i < dispRectNodes.length; i++ ) { dispRectNode = dispRectNodes[ i ]; - rectNode = dispRectNode.getElementsByTagName( "Rect" )[ 0 ]; + rectNode = dispRectNode.getElementsByTagNameNS(ns, "Rect" )[ 0 ]; displayRects.push({ Rect: {