From c225bc3f3dbe5c001e8fec119d8f8dadf96ec95b Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 3 Jul 2016 19:57:37 +0100 Subject: Return root element directly when reading XML --- lib/docx/content-types-reader.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/docx/content-types-reader.js') diff --git a/lib/docx/content-types-reader.js b/lib/docx/content-types-reader.js index 5364b87..8233119 100644 --- a/lib/docx/content-types-reader.js +++ b/lib/docx/content-types-reader.js @@ -13,11 +13,11 @@ var fallbackContentTypes = { exports.defaultContentTypes = contentTypes({}, {}); -function readContentTypesFromXml(xml) { +function readContentTypesFromXml(element) { var extensionDefaults = {}; var overrides = {}; - xml.root.children.forEach(function(child) { + element.children.forEach(function(child) { if (child.name === "content-types:Default") { extensionDefaults[child.attributes.Extension] = child.attributes.ContentType; } -- cgit v1.2.3