You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building a DOM from scratch to seraialize requires creating nsPrefix properties on elements and attributes, but also maintaining proper nsURIif you want to use the omit option during serialization.
Might be better to remove nsPrefix from the DOM and instead decide the prefix based on the defined prefixes (favoring the closest ancestor), based on parsing xmlns:foo attributes during serialization.
Positive: fewer moving parts to keep track of, and fixes the bug that allows serialization of invalid documents. When serializing subtrees could even provide the option of generating namespace attributes as necessary.
Negative: would probably no longer round-trip something like this:
...because the serializer would see that bar was in uriA namespace and deduce that since its parent element had declared that as a default namespace the output out to be:
<fooxmlns="uriA"xmlns:a="uriA"><bar /></foo>
The text was updated successfully, but these errors were encountered:
Building a DOM from scratch to seraialize requires creating
nsPrefix
properties on elements and attributes, but also maintaining propernsURI
if you want to use theomit
option during serialization.Might be better to remove
nsPrefix
from the DOM and instead decide the prefix based on the defined prefixes (favoring the closest ancestor), based on parsingxmlns:foo
attributes during serialization.Positive: fewer moving parts to keep track of, and fixes the bug that allows serialization of invalid documents. When serializing subtrees could even provide the option of generating namespace attributes as necessary.
Negative: would probably no longer round-trip something like this:
...because the serializer would see that
bar
was inuriA
namespace and deduce that since its parent element had declared that as a default namespace the output out to be:The text was updated successfully, but these errors were encountered: