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

Handling of comments seems to be invalid #3

Closed
AlgoTrader opened this issue Apr 3, 2012 · 1 comment
Closed

Handling of comments seems to be invalid #3

AlgoTrader opened this issue Apr 3, 2012 · 1 comment

Comments

@AlgoTrader
Copy link

The code:
// create empty document
var parser = new DOMParser;
var xmldoc = parser.parseFromString('');

// serialize document
var serializer = new XMLSerializer;
var doctxt = serializer.serializeToString(xmldoc);
console.log("xml:",doctxt);

The result:

I don't think it's a good way to serialize comments back.

BTW. the questions is to how to create Document for serialization if exported "classes" are DOMParser and XMLSerializer? Without tricks I can only create document by parsing an empty one

@jindw
Copy link
Owner

jindw commented Apr 9, 2012

fixed
thanks for your report

BTW:
maybe DOMImplementation will help you.
require('xmldom/dom').DOMImplementation

@jindw jindw closed this as completed Apr 9, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants