rem: var range = editorShell.editorDocument.createRange(); range.setStart(heading,0); var lastChildIndex = heading.childNodes.length; range.setEnd(heading,lastChildIndex); var text = range.toString(); dump("Range:"+range+" LastChildIndex = "+lastChildIndex+"\nText: "+text+"\n"); 
add:    var child = heading.firstChild; dump(child.nodeName+" = Heading's first child nodeName\n"); if (child && child.nodeName == "a" && child.name && child.name.length > 0) continue;  var range = editorShell.editorDocument.createRange(); range.setStart(heading,0); var lastChildIndex = heading.childNodes.length; range.setEnd(heading,lastChildIndex); var text = range.toString(); if (text) { if (firstHeading) {  HeadingsIndex = NamedAnchorList.length; AppendStringToListByID(NamedAnchorList,"HeadingsCaption"); firstHeading = false; }   text = PrepareStringForURL(TruncateStringAtWordEnd(text, 40, false));  if (GetExistingAnchorIndex(text) > -1) text += "_";  AppendStringToList(NamedAnchorList," "+text); dump("Heading text for Named Anchor: "+text+"\n");  if (!HNodeArray) HNodeArray = new Array(heading) else HNodeArray[HNodeArray.length] = heading; } } 
context: function FillNamedAnchorList(){  NamedAnchorNodeList = editorShell.editorDocument.anchors;  var headingList = editorShell.editorDocument.getElementsByTagName("h2");  dump(headingList+" Count= "+headingList.length+"\n");  if (headingList.length > 0) {    dump("HELLO\n");    var heading = headingList.item(0);    var range = editorShell.editorDocument.createRange();    range.setStart(heading,0);    var lastChildIndex = heading.childNodes.length;    range.setEnd(heading,lastChildIndex);    var text = range.toString();    dump("Range:"+range+" LastChildIndex = "+lastChildIndex+"\nText: "+text+"\n");  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/711c0f72c9655c2558d43bb716847f1a294b8372/EdLinkProps.js/clean/editor/ui/dialogs/content/EdLinkProps.js