…lines 1–71 unchanged (71 lines)
72 currentElement().appendChild(node);
73 }
74
75 Element insert(Token.StartTag startTag) {
76 Tag tag = Tag.valueOf(startTag.name(), settings);
77 // todo: wonder if for xml parsing, should treat all tags as unknown? because it's not html.
78 startTag.attributes.deduplicate(settings);
79
80 Element el = new Element(tag, baseUri, settings.normalizeAttributes(startTag.attributes));
81 insertNode(el);
82 if (startTag.isSelfClosing()) {
83 if (!tag.isKnownTag()) // unknown tag, remember this is self closing for output. see above.
84 tag.setSelfClosing();
…lines 85–154 unchanged (70 lines)