I want to use xmldom together with equivalent-xml-js.
To be able to complete my task, I need to be able to check the type of a part of my XML file.
Unfortunately, the types Document, Element, Attr, Text and CDATASection are not accessible from outside the xmldom file.
Code Example:
switch (node_1.constructor) {
case xmlDom.DOMImplementation.Document:
result = compare_documents(node_1, node_2, opts);
break;
case xmlDom.DOMImplementation.Element:
result = compare_elements(node_1, node_2, opts);
break;
case xmlDom.DOMImplementation.Attr:
result = compare_attributes(node_1, node_2, opts);
break;
case xmlDom.DOMImplementation.Text:
result = compare_text(node_1, node_2, opts);
break;
case xmlDom.DOMImplementation.CDATASection:
result = compare_cdata(node_1, node_2, opts);
break;
default:
result = compare_children(node_1, node_2, opts);
}
How can I access those types so I can check after them?
Hey,
I want to use xmldom together with equivalent-xml-js. To be able to complete my task, I need to be able to check the type of a part of my XML file. Unfortunately, the types Document, Element, Attr, Text and CDATASection are not accessible from outside the xmldom file.
Code Example:
How can I access those types so I can check after them?
Thanks!