diff options
| author | Michael Williamson <mike@zwobble.org> | 2014-03-18 14:15:33 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2014-03-18 14:15:33 +0000 |
| commit | 45f302766a3a5ca99338fd8e5fef07dec42c0e56 (patch) | |
| tree | e5081b43310e6c3698c08ab021e0d61d0a84d09c /lib/relationships-reader.js | |
| parent | dca50ccd84f91a7db2a41a59e15b3ed95b2c3f46 (diff) | |
Move modules for docx reading into separate directory
Diffstat (limited to 'lib/relationships-reader.js')
| -rw-r--r-- | lib/relationships-reader.js | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/lib/relationships-reader.js b/lib/relationships-reader.js deleted file mode 100644 index fe6c7f1..0000000 --- a/lib/relationships-reader.js +++ /dev/null @@ -1,25 +0,0 @@ -var readXmlFromZipFile = require("./office-xml-reader").readXmlFromZipFile; - - -exports.readRelationshipsFromZipFile = readRelationshipsFromZipFile; - - -function readRelationshipsFromZipFile(file) { - return readXmlFromZipFile(file, "word/_rels/document.xml.rels") - .then(function(relationshipsXml) { - return relationshipsXml ? readRelationships(relationshipsXml) : {}; - }); -} - - -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; -} |
