doc.root.setTag('span');
expect(doc.root.getTagName()).to.equal('span');
});
+
+ it('keeps contents', function() {
+ var node = elementNodeFromXML('<div><div></div></div>');
+ node.setTag('header');
+ expect(node.contents()).to.have.length(1);
+ });
});
expect(input.isEqualNode(output)).to.be.true;
});
+
+ it('keeps entities intact', function() {
+ var xmlIn = '<section>< ></section>',
+ doc = getDocumentFromXML(xmlIn),
+ xmlOut = doc.toXML();
+ expect(xmlOut).to.equal(xmlIn);
+ });
+ it('keeps entities intact when they form html/xml', function() {
+ var xmlIn = '<section><abc></section>',
+ doc = getDocumentFromXML(xmlIn),
+ xmlOut = doc.toXML();
+ expect(xmlOut).to.equal(xmlIn);
+ });
});
});