2

Use of a nametable: I understood that its much faster to check for equality of two objects, instead of using the char by char string comparer.(If you get the object from the nametable, it will always return the same reference) (An atomized string is just an string in a nametable)

Greetings

  • Any namespace prefix must be defined before it is used when parsing an xml file. Sometimes the definition is in the webpage for a different xml. The links you provided aren't for valid xml files. – jdweng May 16 '16 at 07:24

1 Answers1

1

See the MSDN:

Implements a single-threaded XmlNameTable.

Remarks

Several classes, such as XmlDocument and XmlReader, use the NameTable class internally to store attribute and element names. When an element or attribute name occurs multiple times in an XML document, it is stored only once in the NameTable.

The names are stored as common language runtime (CLR) object types. This enables you to do object comparisons on these strings rather than a more expensive string comparison. These string objects are referred to as atomized strings.

Community
  • 1
  • 1
Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331
  • @user6216224:- Which point? Did you see these links? http://stackoverflow.com/questions/879728/can-i-use-predefined-namespaces-when-loading-an-xdocument and http://stackoverflow.com/questions/934486/how-do-i-get-a-nametable-from-an-xdocument – Rahul Tripathi May 16 '16 at 06:55
  • That is the point i don't understand: -If name occurs multiple times, that are stored in this object only once, and then evrytime the name occurs, its reffering to the same object? -What is the difference between normal and atomized strings (Probelms with the App ;) ) –  May 16 '16 at 07:01