summaryrefslogtreecommitdiff
path: root/lib/docx/relationships-reader.js
blob: 7cae534f477e29a3a1f37fee6b78588e40943dc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
exports.readRelationships = readRelationships;


function readRelationships(relationshipsXml) {
    var relationships = {};
    relationshipsXml.root.children.forEach(function(child) {
        if (child.name === "{http://schemas.openxmlformats.org/package/2006/relationships}:Relationship") {
            relationships[child.attributes.Id] = {
                target: child.attributes.Target
            };
        }
    });
    return relationships;
}