mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-29 00:26:10 +03:00
always use getElementsByTagNameNS since it will work for DZI xml with or without ns prefix
This commit is contained in:
parent
343f9ed367
commit
fd0d8d4507
@ -234,11 +234,7 @@ function configureFromXML( tileSource, xmlDoc ){
|
|||||||
if ( rootName == "Image" ) {
|
if ( rootName == "Image" ) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
sizeNode = root.getElementsByTagName( "Size" )[ 0 ];
|
|
||||||
// if finding by tag name failed, attempt to find with namespace
|
|
||||||
if (sizeNode === undefined) {
|
|
||||||
sizeNode = root.getElementsByTagNameNS(ns, "Size" )[ 0 ];
|
sizeNode = root.getElementsByTagNameNS(ns, "Size" )[ 0 ];
|
||||||
}
|
|
||||||
|
|
||||||
configuration = {
|
configuration = {
|
||||||
Image: {
|
Image: {
|
||||||
@ -261,16 +257,11 @@ function configureFromXML( tileSource, xmlDoc ){
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
dispRectNodes = root.getElementsByTagName( "DisplayRect" );
|
|
||||||
if (dispRectNodes.length === 0) {
|
|
||||||
dispRectNodes = root.getElementsByTagNameNS(ns, "DisplayRect" );
|
dispRectNodes = root.getElementsByTagNameNS(ns, "DisplayRect" );
|
||||||
}
|
|
||||||
for ( i = 0; i < dispRectNodes.length; i++ ) {
|
for ( i = 0; i < dispRectNodes.length; i++ ) {
|
||||||
dispRectNode = dispRectNodes[ i ];
|
dispRectNode = dispRectNodes[ i ];
|
||||||
rectNode = dispRectNode.getElementsByTagName( "Rect" )[ 0 ];
|
|
||||||
if (rectNode === undefined) {
|
|
||||||
rectNode = dispRectNode.getElementsByTagNameNS(ns, "Rect" )[ 0 ];
|
rectNode = dispRectNode.getElementsByTagNameNS(ns, "Rect" )[ 0 ];
|
||||||
}
|
|
||||||
|
|
||||||
displayRects.push({
|
displayRects.push({
|
||||||
Rect: {
|
Rect: {
|
||||||
|
Loading…
Reference in New Issue
Block a user