Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "Unexpected xml node in parseOpen" bug in LibreOffice documents for attributes dc:language and cp:revision #212

Merged
merged 2 commits into from
Nov 1, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/xlsx/xform/core/core-xform.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var props = {
title: 'Title',
subject: 'Subject',
description: 'Comments',
language: 'Language',
keywords: 'Tags',
category: 'Categories'
};
Expand All @@ -43,10 +44,12 @@ var CoreXform = module.exports = function() {
'dc:title': new StringXform({tag: 'dc:title'}),
'dc:subject': new StringXform({tag: 'dc:subject'}),
'dc:description': new StringXform({tag: 'dc:description'}),
'dc:language': new StringXform({tag: 'dc:language'}),
'cp:keywords': new StringXform({tag: 'cp:keywords'}),
'cp:category': new StringXform({tag: 'cp:category'}),
'cp:lastModifiedBy': new StringXform({tag: 'cp:lastModifiedBy'}),
'cp:lastPrinted': new DateXform({tag: 'cp:lastPrinted', format: CoreXform.DateFormat}),
'cp:revision': new DateXform({tag: 'cp:revision'}),
'dcterms:created': new DateXform({tag: 'dcterms:created', attrs: CoreXform.DateAttrs, format: CoreXform.DateFormat}),
'dcterms:modified': new DateXform({tag: 'dcterms:modified', attrs: CoreXform.DateAttrs, format: CoreXform.DateFormat})
}
Expand Down Expand Up @@ -75,10 +78,12 @@ utils.inherits(CoreXform, BaseXform, {
this.map['dc:title'].render(xmlStream, model.title);
this.map['dc:subject'].render(xmlStream, model.subject);
this.map['dc:description'].render(xmlStream, model.description);
this.map['dc:language'].render(xmlStream, model.language);
this.map['cp:keywords'].render(xmlStream, model.keywords);
this.map['cp:category'].render(xmlStream, model.category);
this.map['cp:lastModifiedBy'].render(xmlStream, model.lastModifiedBy);
this.map['cp:lastPrinted'].render(xmlStream, model.lastPrinted);
this.map['cp:revision'].render(xmlStream, model.revision);
this.map['dcterms:created'].render(xmlStream, model.created);
this.map['dcterms:modified'].render(xmlStream, model.modified);

Expand Down Expand Up @@ -122,10 +127,12 @@ utils.inherits(CoreXform, BaseXform, {
title: this.map['dc:title'].model,
subject: this.map['dc:subject'].model,
description: this.map['dc:description'].model,
language: this.map['dc:language'].model,
keywords: this.map['cp:keywords'].model,
category: this.map['cp:category'].model,
lastModifiedBy: this.map['cp:lastModifiedBy'].model,
lastPrinted: this.map['cp:lastPrinted'].model,
Revision: this.map['cp:revision'].model,
created: this.map['dcterms:created'].model,
modified: this.map['dcterms:modified'].model
};
Expand Down