ZVON > References > DOM2 Reference

normalize (method )

Owning interface and usage:  
Node.normalize()

Member of these other interfaces:  
Attr, CDATASection, CharacterData, Comment, Document, DocumentFragment, DocumentType, Element, Entity, EntityReference, Notation, ProcessingInstruction, Text

Description:  
Puts all Text nodes in the full depth of the sub-tree underneath this node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes.

Parameters:  
none

Returns:  
nothing

Exceptions:  
none

Note:  


Example:
Source:
  <div id="doc"></div>
JavaScript:
  var main = document.getElementById('doc');
  var output1 = main.childNodes.length;
  var textNode1 = document.createTextNode('This is some text.');
  var textNode2 = document.createTextNode('This is another text.');
  main.appendChild(textNode1);
  main.appendChild(textNode2);
  var output2 = main.childNodes.length;
  main.normalize();
  var output3 = main.childNodes.length;
Output:
desired your browser
output1: 0
output2: 2
output3: 1



_____________________________________________
Reference Search | Sitemap | XML Glossary       ZVON | Systinet




Related sites:
  • dotNet Slackers - Your latest resource for ASP.NET
  • Dotnet Spider - Outsourcing and Offshore software development in India
  • XML - Xselerator, XSL Editor, BizTalk Utilities, XML Tutorials, Learn XML
  • Planet Source Code - The largest public source code database on the Internet
Domain Names conference call service UNLIMITED Web Hosting by HostDepartment Alojamiento Web answering service
MSN VoIP Internettelefonie Hosted Exchange, SDSL VoIP Internettelefonie AT VoIP Internettelefonie DE