lib/utils/xml-utils.js
function getProtectedBinary(node) {
    if (node.protectedValue) {
        return node.protectedValue;
    }
    var text = node.textContent;
    var ref = node.getAttribute(XmlNames.Attr.Ref);
    if (ref) {
        return { ref: ref };
    }
    if (!text) {
        return undefined;
    }
    var compressed = strToBoolean(node.getAttribute(XmlNames.Attr.Compressed));
    var bytes = ByteUtils.base64ToBytes(text);
    if (compressed) {
        bytes = pako.ungzip(bytes);
    }
    return ByteUtils.arrayToBuffer(bytes);
}
function getProtectedBinary(node) {
    if (node.protectedValue) {
        return node.protectedValue;
    }
    var text = node.textContent;
    var ref = node.getAttribute(XmlNames.Attr.Ref);
    if (ref) {
        return { ref: ref };
    }
    if (!text) {
        return undefined;
    }
    var compressed = strToBoolean(node.getAttribute(XmlNames.Attr.Compressed));
    var bytes = ByteUtils.base64ToBytes(text);
    if (compressed) {
        bytes = pako.ungzip(bytes);
    }
    return ByteUtils.arrayToBuffer(bytes);
}
function getProtectedBinary ( node ) { if ( node . protectedValue ) { return node . protectedValue ; } var text = node . textContent ; var ref = node . getAttribute ( XmlNames . Attr . Ref ) ; if ( ref ) { return { ref : ref } ; } if ( ! text ) { return undefined ; } var compressed = strToBoolean ( node . getAttribute ( XmlNames . Attr . Compressed ) ) ; var bytes = ByteUtils . base64ToBytes ( text ) ; if ( compressed ) { bytes = pako . ungzip ( bytes ) ; } return ByteUtils . arrayToBuffer ( bytes ) ; }
Gets node protected text from inner text
@param {Node} node
@return {ProtectedValue|ArrayBuffer|{ref: string}} - protected value, or array buffer, or reference to binary
Gets node protected text from inner text