Hi Bas,
I managed to find the solution. in 1 place the 1 line code was missing. I will state here so other may benefit it.
function ShowXML(xmlHolderElement, RootNode, indent) {
if (RootNode == null || xmlHolderElement == null) { return false; }
var Result = true;
var TagEmptyElement = document.createElement('div');
TagEmptyElement.className = 'Element';
TagEmptyElement.style.position = 'relative';
TagEmptyElement.style.left = NestingIndent + 'px';
if (RootNode.childNodes.length == 0) {
var ClickableElement = AddTextNode(TagEmptyElement, '', 'Clickable');
ClickableElement.id = 'div_empty_' + IDCounter;
++IDCounter;
AddTextNode(TagEmptyElement, '<', 'Utility');
AddTextNode(TagEmptyElement, RootNode.nodeName, 'NodeName')
for (var i = 0; RootNode.attributes && i < RootNode.attributes.length; ++i) {
CurrentAttribute = RootNode.attributes.item(i);
AddTextNode(TagEmptyElement, ' ' + CurrentAttribute.nodeName, 'AttributeName');
AddTextNode(TagEmptyElement, '=', 'Utility');
AddTextNode(TagEmptyElement, '"' + CurrentAttribute.nodeValue + '"', 'AttributeValue');
}
AddTextNode(TagEmptyElement, ' />');
xmlHolderElement.appendChild(TagEmptyElement);
//SetVisibility(TagEmptyElement,true);
}
The ++IDCounter in red was missing in this function. So due to this, if the previous node is empty as like:
<Mail xsi:nil="true" />
-<FrontPage>MidOffer </FrontPage>
so in that case the id for Mail and FrontPage were getting same. And due to this if we click on "-" the whole node vanishes. But after incrementing the counter; all the nodes were incremented correctly and nothing vanishes.
Awesome.
GB Thanks to the creator "Lev Muchnik".
Bas, shall I mail Lev Muchnik regarding this change in code, so he updates the code in his blog.
Thank you again Bas. :)
I am marking this post as answer too as it contains the corrected code.