lib/client.js
function(xmlBody) {

        var parser = new DOMParser();
        var doc = parser.parseFromString(xmlBody, "application/xml");

        var resolver = function(foo) {
            var ii;
            for(ii in this.xmlNamespaces) {
                if (this.xmlNamespaces[ii] === foo) {
                    return ii;
                }
            }
        }.bind(this);

        var responseIterator = doc.evaluate('/d:multistatus/d:response', doc, resolver, XPathResult.ANY_TYPE, null);

        var result = [];
        var responseNode = responseIterator.iterateNext();

        while(responseNode) {

            var response = {
                href : null,
                propStat : []
            };

            response.href = doc.evaluate('string(d:href)', responseNode, resolver, XPathResult.ANY_TYPE, null).stringValue;

            var propStatIterator = doc.evaluate('d:propstat', responseNode, resolver, XPathResult.ANY_TYPE, null);
            var propStatNode = propStatIterator.iterateNext();

            while(propStatNode) {
                var propStat = {
                    status : doc.evaluate('string(d:status)', propStatNode, resolver, XPathResult.ANY_TYPE, null).stringValue,
                    properties : {},
                };

                var propIterator = doc.evaluate('d:prop/*', propStatNode, resolver, XPathResult.ANY_TYPE, null);

                var propNode = propIterator.iterateNext();
                while(propNode) {
                    var content = this._parsePropNode(propNode);
                    propStat.properties['{' + propNode.namespaceURI + '}' + propNode.localName] = content;
                    propNode = propIterator.iterateNext();

                }
                response.propStat.push(propStat);
                propStatNode = propStatIterator.iterateNext();


            }

            result.push(response);
            responseNode = responseIterator.iterateNext();

        }

        return result;

    }
function(xmlBody) {

        var parser = new DOMParser();
        var doc = parser.parseFromString(xmlBody, "application/xml");

        var resolver = function(foo) {
            var ii;
            for(ii in this.xmlNamespaces) {
                if (this.xmlNamespaces[ii] === foo) {
                    return ii;
                }
            }
        }.bind(this);

        var responseIterator = doc.evaluate('/d:multistatus/d:response', doc, resolver, XPathResult.ANY_TYPE, null);

        var result = [];
        var responseNode = responseIterator.iterateNext();

        while(responseNode) {

            var response = {
                href : null,
                propStat : []
            };

            response.href = doc.evaluate('string(d:href)', responseNode, resolver, XPathResult.ANY_TYPE, null).stringValue;

            var propStatIterator = doc.evaluate('d:propstat', responseNode, resolver, XPathResult.ANY_TYPE, null);
            var propStatNode = propStatIterator.iterateNext();

            while(propStatNode) {
                var propStat = {
                    status : doc.evaluate('string(d:status)', propStatNode, resolver, XPathResult.ANY_TYPE, null).stringValue,
                    properties : {},
                };

                var propIterator = doc.evaluate('d:prop/*', propStatNode, resolver, XPathResult.ANY_TYPE, null);

                var propNode = propIterator.iterateNext();
                while(propNode) {
                    var content = this._parsePropNode(propNode);
                    propStat.properties['{' + propNode.namespaceURI + '}' + propNode.localName] = content;
                    propNode = propIterator.iterateNext();

                }
                response.propStat.push(propStat);
                propStatNode = propStatIterator.iterateNext();


            }

            result.push(response);
            responseNode = responseIterator.iterateNext();

        }

        return result;

    }
function ( xmlBody ) { var parser = new DOMParser ( ) ; var doc = parser . parseFromString ( xmlBody , "application/xml" ) ; var resolver = function ( foo ) { var ii ; for ( ii in this . xmlNamespaces ) { if ( this . xmlNamespaces [ ii ] === foo ) { return ii ; } } } . bind ( this ) ; var responseIterator = doc . evaluate ( '/d:multistatus/d:response' , doc , resolver , XPathResult . ANY_TYPE , null ) ; var result = [ ] ; var responseNode = responseIterator . iterateNext ( ) ; while ( responseNode ) { var response = { href : null , propStat : [ ] } ; response . href = doc . evaluate ( 'string(d:href)' , responseNode , resolver , XPathResult . ANY_TYPE , null ) . stringValue ; var propStatIterator = doc . evaluate ( 'd:propstat' , responseNode , resolver , XPathResult . ANY_TYPE , null ) ; var propStatNode = propStatIterator . iterateNext ( ) ; while ( propStatNode ) { var propStat = { status : doc . evaluate ( 'string(d:status)' , propStatNode , resolver , XPathResult . ANY_TYPE , null ) . stringValue , properties : { } , } ; var propIterator = doc . evaluate ( 'd:prop/*' , propStatNode , resolver , XPathResult . ANY_TYPE , null ) ; var propNode = propIterator . iterateNext ( ) ; while ( propNode ) { var content = this . _parsePropNode ( propNode ) ; propStat . properties [ '{' + propNode . namespaceURI + '}' + propNode . localName ] = content ; propNode = propIterator . iterateNext ( ) ; } response . propStat . push ( propStat ) ; propStatNode = propStatIterator . iterateNext ( ) ; } result . push ( response ) ; responseNode = responseIterator . iterateNext ( ) ; } return result ; }
Parses a multi-status response body.

@param {string} xmlBody
@param {Array}
Parses a multi - status response body .