-
Notifications
You must be signed in to change notification settings - Fork 120
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
Implement XMLSerializer #42
base: master
Are you sure you want to change the base?
Conversation
Not sure if this complies with the specification but it's definitely needed when dealing with XML content.
The spec for the HTML serialization algorithm is found at http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#serializing-html-fragments Your addition is not spec compliant (and doesn't pass our test suite). I would consider adding this as an optional feature, though, if you can think of a reasonable way to enable it. You should ensure that it passes the test suite even with the feature enabled, though: in particular, according to the test suite you seem to be emitting an unnecessary |
The following code outputs the same result in Chrome, Firefox and IE9:
The equivalent in domino doesn't respect the namespace and the self-closing:
The latter is not that important but the lack of namespaces can be a deal breaker. I'll see if I can come up with a change that doesn't break the existing tests. |
Again, your addition is not spec compliant (and doesn't pass the test suite). There are specs for XML serialization, see http://www.w3.org/TR/DOM-Parsing/#the-xmlserializer-interface -- that's what you should implement if you want an XML serialization of the document. |
Not sure if this complies with the specification but it's definitely needed when dealing with XML content.