Question: I have js function which is trying to set XMLDoc object and also setting one of the global parameter (modelingDiagram).

While trying to get elements by tag name, it is returning always empty list (but not in firefox). 
During debugging I come to know that it is returning empty list for any tag that I try in watch area - 
 xmlDoc.getElementsByTagName('Processes'); OR xmlDoc.getElementsByTagName("desc");

Following is the js function. Commented area indicates where I got the exception.

```
function setXmlDoc(text)
{
if (window.ActiveXObject){
              var doc=new ActiveXObject('Microsoft.XMLDOM');
              doc.async='false';
              doc.loadXML(text);
} else {
              var parser=new DOMParser();
              var doc=parser.parseFromString(text,'text/xml');
}

xmlDoc = doc;
modelingDiagram = xmlDoc.getElementsByTagName('Processes')[0].getElementsByTagName('ModelingDiagram');
//Uncaught TypeError: Cannot call method 'getElementsByTagName' of undefined
}

```

text variable contains xml in string format- 

```
<?xml version="1.0" encoding="utf-8"?>
<Processes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="">
  <Process>
    <desc value="Z45 Accounting">Z45 Accounting</desc>
    <height value="541">541</height>
    <width value="411">411</width>
    <xval value="50">50</xval>
    <yval value="50">50</yval>
    <Flowelements>
   ....
   ....
   ....

```

I could not able to make out what is that Chrome is expecting here to get the proper list?

Answer: 
Vertical [margins collapse](http://www.w3.org/TR/CSS21/box.html#collapsing-margins) into each other (according to some fairly complex rules which you can find at the other end of that link), so the inner margin-top occupies the bottom half of the outer margin-top.
I think this is about margin collapsing. <http://reference.sitepoint.com/css/collapsingmargins> has information about this.

Here is a workaround/solution of this.

```
<div id="outer">
    &nbsp;
    <div id="inner">
        Text
    </div>
    &nbsp;
</div>

```

​